-------------- Original message ---------------------- From: Paul Lussier <[EMAIL PROTECTED]> > [EMAIL PROTECTED] writes: > > > Actually, if you are looking for only lines that contain the string "univ", > then you would want to grep for it: > > > > grep univ abc.txt | cut -f3 -d, >> dev.txt. > > Why are you appending to dev.txt? (or def.txt even). Are you assuming > the file already exists and don't want to over-write the contents? >
That is exactly what I was thinking. Even if it isn't being appended to, The result is essentially the same. Unless, of course, you want to over-write the file. Then that would work out to well. It's better to be safe then sorry :-) Besides, I've been doing a log of this sort of thing in the last few days, and the >> just sort of rolled off my fingertips. > > Paul's example would give you the third field of each line, even if > > they don't have "univ" in them. Now, if you wanted to remove the > > quotes, then you would need something like: > > > > > > grep univ abc.txt | cut -f3 -d, | sed s/\"//g >> dev.txt > > yep, that should work, but no need for the >> when a simple > will do. What? Two redirects are better then one, right :-) C-Ya, Kenny _______________________________________________ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss