Linux command help

Kush

High On Life!
Joined
13 Jan 2002
Messages
4,590
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
 
can you give an example of the type of data you are wanting to use as input and the relevant output for that example
 
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.
 
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
 
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!)
 
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
 
themafia.69 said:
wheres the irc channel i cant find it
OK - like I said before - irc.freenode.net then channel is (amazingly) called #justlinux ! :dead:
 
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:
 
****

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
 
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
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back