|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | 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. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Shell :copying the content from one file to another
I have a log containing the below lines. file1.log ----------- Code:
module: module1 module10 module2 module002 module9 moduleRT100.2.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 moduleRT100.3.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 file2.log Code:
module1 module10 module2 module002 module9 Now file2 has to be generated from file1 by eliminating all module: and moduleRT etc. Only module that are postfixed with number has to be copied to file2.log Could anyone please help me in this regard |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Try: Code:
grep -vE '^module(:|RT)' infile > outfile |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| To tar the content while copying files | gsiva | Shell Programming and Scripting | 2 | 06-12-2012 12:05 AM |
| Copying the content of a filesystem to different Harddrive | skamal4u | Solaris | 1 | 02-11-2009 11:14 PM |
| Copying the content of a filesystem to different Harddrive | skamal4u | UNIX for Dummies Questions & Answers | 0 | 02-11-2009 06:18 PM |
| Copying selected content from file | misenkiser | Shell Programming and Scripting | 1 | 10-05-2006 09:42 AM |
| copying content of a file | talzohar | UNIX for Dummies Questions & Answers | 2 | 03-05-2005 09:16 PM |
|
|