![]() |
|
|
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 edit a txt file ? | RRVARMA | Shell Programming and Scripting | 4 | 05-30-2008 09:40 AM |
| edit a file using ksh | meghana | Shell Programming and Scripting | 3 | 04-16-2008 12:04 PM |
| Edit value in File | sewood | Shell Programming and Scripting | 1 | 03-18-2008 02:11 AM |
| How to edit env file | duke0001 | UNIX for Advanced & Expert Users | 3 | 02-16-2007 11:43 AM |
| Edit an ISO / dd file? | WIntellect | Filesystems, Disks and Memory | 4 | 11-20-2002 05:21 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
file edit help
Hi,
Could anyone give me a idea how to strip the lines from a given file. example *********** 1st occurence 1st occurence 1st occurence 1st occurence *********** 2nd occurence 2nd occurence 2nd occurence 2nd occurence 2nd occurence 2nd occurence ************* 3rd occurence 3rd occurence 3rd occurence 3rd occurence ************* I want to strip the lines between last occurencei:e 3rd occurence to a new file. rgds ss |
|
||||
|
I don't have gawk on my system. I am using sun OS.
But I am tring the below, which is not working either awk '{ if( $1 == "**********************************" ) { n=split($2,arr,">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); file=arr[n-1] ".txt" } print file }' $HOME/tmp/xxxxx.log |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|