I do not know how efficient this is for a 2 GB file, but, normally, I would have done the following:
cat <filename> | grep <string> > file1
cat <filename> | grep -v -ffile1
If you want to append the contents of file1 to file2,
cat file2 file1 > file3
Cheers
Sathyaram
Quote:
Originally posted by sunragh
dear all,
I want to extract all the lines from a file which is more than 2GB, containing a particular string and these lines are to be appended to a file.
In the next step, the extracted lines from the old file are to be deleted.
Thanks in advance.
sunil
|