|
|||||||
| 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 from one file to another file
Code:
vat.log -------- null null statistics null null null Storage Response Time disk space1 disk space2 I have a log as mentioned above in which I need to copy only the below content to another file using shell scripting. In between null statistics and final null it also includes blank line as well.. Code:
null statistics null null null Could anyone please help me in this regard? Thanks in advance... |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Code:
$ awk 'p&&$1&&$1!="null"{p=0}; /null statistics/ {p=1}p' file
null statistics
null
null
null |
| 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 |
| Copying Information from One File to Another File in Shell | tamachan414 | Shell Programming and Scripting | 1 | 07-13-2011 04:27 PM |
| Help with searching for a file in a directory and copying the contents of that file in a new file | zel2zel | UNIX for Dummies Questions & Answers | 6 | 03-05-2011 12:44 PM |
| sed command for copying the contents of other file replacing it another file on specifc pattern | balrajg | Shell Programming and Scripting | 0 | 01-26-2011 09:42 PM |
| Strange difference in file size when copying LARGE file.. | 0ktalmagik | Filesystems, Disks and Memory | 1 | 06-03-2006 07:34 PM |
| copying the csv file into different worksheets of xls file | nimish | Shell Programming and Scripting | 0 | 10-03-2005 11:30 PM |
|
|