10-04-2004
303,
1
Join Date: Mar 2002
Last Activity: 20 January 2016, 4:16 AM EST
Posts: 303
Thanks Given: 1
Thanked 1 Time in 1 Post
example file
xxxxxxxxx,xxxxxxxxx,xxxxxxxxx,xxxxxxxxx,xxx,001,xxx
xxxxxxxxx,xxxxxxxxx,xxxxxxxxx,xxxxxxxxx,xxx,002,xxx
xxxxxxxxx,xxxxxxxxx,xxxxxxxxx,xxxxxxxxx,xxx,004,xxx
xxxxxxxxx,xxxxxxxxx,xxxxxxxxx,xxxxxxxxx,xxx,007,xxx
xxxxxxxxx,xxxxxxxxx,xxxxxxxxx,xxxxxxxxx,xxx,002,xxx
xxxxxxxxx,xxxxxxxxx,xxxxxxxxx,xxxxxxxxx,xxx,002,xxx
os = solaris9
shell = ksh
I tried the command
grep -v '.\{44\}002.*' infile > outfile
but this just removes the 002's completely and populates the outfile with whatever is left, how can I can i create a second outfile (say outfile2) using the same method but this time putting just the 002's in there, as i say, i need tio keep the extracted 002's in a seperate file
cheers