![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| Rename file based on first 3 characters of data in file | jchappel | UNIX for Dummies Questions & Answers | 3 | 10-01-2008 02:21 PM |
| Extracting data from text file based on configuration set in config file | suparnbector | Shell Programming and Scripting | 3 | 08-10-2007 02:25 AM |
| how to delete record in file data with index in another file? | zhynxn | Shell Programming and Scripting | 0 | 07-06-2006 12:03 AM |
| i want to delete a file based on existing file in a directory | srivsn | Shell Programming and Scripting | 3 | 04-11-2006 04:38 AM |
| Append a field to the end of each line of a file based on searching another file. | ultimate | Shell Programming and Scripting | 2 | 03-29-2005 10:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi there
I would like to create a shell script to do the following: - delete a line in file1 if it contains the data string in file2 eg: file1 1 100109942004051510601703694 0.00 0.00 2 100109942004051510601702326 0.00 0.00 3 100109942004051510601702327 0.00 0.00 file2 1 3694 2 3741 3 3834 In the above example line1 of file1 must be deleted because it contains the string of line1 in file2 "3694". Also, the data sting must be in position 24 in each line 100109942004051510601703694 0.00 0.00 for it to be deleted. Hope this is sufficient information for a possible solution. I never did any shell scripting before so the help would very much be appreciated. ![]() Thanks |
|
||||
|
Use grep, check the the -v and -f option in the manpage.
Regards |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| sed delete line |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|