![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to delete content in a file (delete content only) | kittusri9 | Shell Programming and Scripting | 5 | 05-15-2008 02:12 PM |
| searching content of files in the current and sub directories | tiger99 | Shell Programming and Scripting | 4 | 01-23-2008 03:11 AM |
| Removing lines that are (same in content) based on columns | adsforall | UNIX for Dummies Questions & Answers | 7 | 11-09-2007 12:13 PM |
| searching for content of files | Aretai | UNIX for Dummies Questions & Answers | 19 | 03-09-2007 06:44 AM |
| Please Help. Need Help searching for multiple stings in a file and removing them. | mjs3221 | UNIX for Advanced & Expert Users | 2 | 08-19-2006 07:28 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Searching and Removing File Content
Hi,
I am trying to search a character in a file and remove it from that file.... My file looks something like this: test1.txt ckj12300_00|123|var1|10.2 ckj00200_12|444|var2|11.2 ckj00200_14|4556|var3|33.5 c00200_00_000|4558|var4|33.5 ckj00200_14|4553|var5|33.5 c00200_00_000|453|var7|33.5 ckj00200_14|454|var8|33.5 c00200_00_000|4567|var50|40.2 and so on.... I have to find rows that has c00200_00_000 and remove it from file. The file is about 33 MB and there are quite a few rows with c00200_00_000. I tried grep c00200_00_000 test1.txt >test2.txt .....>This command only finds the c00200_00_000 and puts it in test2.txt but does not remove it from file.... Any help will be appreciated..... |
|
||||
|
Hitting another issue....
Thanks for the quick reply......I tried
grep - v and it worked.... I am hitting another problem using this......If I create another file(s)..I get into space issue.....Is there a way to remove the c00200_00_000 ....from the original file without creating a copy of it... I tried something like this: grep -v c00200_00_000 test1.txt >test2.txt ...> I am copying the filtered data into another file test2..... Is there a way I can remove it from test1.txt without creating a copy test2.txt.... Thanks again for your time and reply..... |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|