Linux command help

Discussion in 'Linux & BSD' started by Kush, Dec 4, 2005.

  1. Kush

    Kush High On Life!

    Messages:
    4,590
    Location:
    Montreal, Quebec
    So i got some help and did the command, but its not doing it correctly according to the submission script i get 0 lines correct and 0 in the right order.



    From the file ~unx122/public/data.txt, select all of the lines that
    have a word in column one which starts with a vowel and ends with a consonant
    and have two even digits in the last column..

    Sort these lines in reverse order according to column 4, then
    select lines 0 through 52. Finally, put these lines in
    normal order according to column 3 and write them to the file
    ~/uli101_a2_output.txt (overwrite any data already in that file).


    grep '^[aeiouAEIOU][a-zA-Z]*[^aeiouAEIOU] .*[02468]\{2\}$' ~unx122/public/data.txt | sort -r +3 | head -53 | sort +2 > uli101_a2_output.txt
     
  2. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    can you give an example of the type of data you are wanting to use as input and the relevant output for that example
     
  3. Kush

    Kush High On Life!

    Messages:
    4,590
    Location:
    Montreal, Quebec
    well its a text fille with 18000 lines, first it has a word, then a space and a four digit number then a space, then another four digit number and another, and another etc.
     
  4. Kush

    Kush High On Life!

    Messages:
    4,590
    Location:
    Montreal, Quebec
    grep '^[aeiouAEIOU][a-zA-Z]*[^aeiouAEIOU] .*[0-9|02468]\{4\}$' ~unx122/public/data.txt | sort -r +3 | head -53 | sort +2 > uli101_a2_output.txt

    gets me 12 in the correct position, and 40 lines correct, out of the 53, i need 53 on both :) im sorry to keep bugin u guys, but i need to submit this by 11:59 pm and im panicing, i cant figure it out
     
  5. Mainframeguy

    Mainframeguy Debiant by way of Ubuntu Folding Team

    Messages:
    3,763
    Location:
    London, UK
    Hate to say this - but if you're in a hurry you need to consider the right forum!

    Check out here and esp. their freenode IRC channel, if approached right you may get instant help there (say MFG sent ya if it helps!)
     
    Kush likes this.
  6. Kush

    Kush High On Life!

    Messages:
    4,590
    Location:
    Montreal, Quebec
    wheres the irc channel i cant find it
     
  7. Kush

    Kush High On Life!

    Messages:
    4,590
    Location:
    Montreal, Quebec
    no one replied on the other forum help please in anyway, i dont wanna turn it in late, i hate doing that ive been working on it for the last couple of hours with no luck
     
  8. Mainframeguy

    Mainframeguy Debiant by way of Ubuntu Folding Team

    Messages:
    3,763
    Location:
    London, UK
    OK - like I said before - irc.freenode.net then channel is (amazingly) called #justlinux ! :dead:
     
  9. Kush

    Kush High On Life!

    Messages:
    4,590
    Location:
    Montreal, Quebec
    irc doesnt work here on my school connection at all, im trying though but still doesnt connect, my school connection is really stupid, could you please ask for me mfg? im really sorry to bug u like this rep again once i can :dead:
     
  10. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
    This one has me baffled.
     
    Kush likes this.
  11. Kush

    Kush High On Life!

    Messages:
    4,590
    Location:
    Montreal, Quebec
    ****

    i emailed the teacher earlier today because he said if u need help email me ur output input instructions etc, i did but he didnt reply, and frankly i am not ganna accept a late mark on this because we never learnt this complex in grep etc, im really mad how can they give us things that we didnt learn
     
  12. Kush

    Kush High On Life!

    Messages:
    4,590
    Location:
    Montreal, Quebec
    YAY I GOT IT!!!! i had the idea of checking the script that checks and me and fisgboy went it and found what it was looking for, the correct one is this
    grep -i '^[aeiou][a-z]*[^aeiou] .*[24680][0-9]*[24680][0-9]*$'
    but for this i thought it would just do the last two digits, but what do i know they are probably right