![]() |
|
|
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 |
| Creating an unknown number of arrays | ajgwin | Shell Programming and Scripting | 2 | 05-23-2008 04:49 PM |
| sed - searching for string and storing in variable | melias | Shell Programming and Scripting | 4 | 04-12-2008 03:57 PM |
| How to split the String based on condition? | sankar reddy | Shell Programming and Scripting | 2 | 03-19-2008 07:48 AM |
| printf returning unknown number | m0nk3y | Shell Programming and Scripting | 1 | 08-08-2005 12:31 PM |
| How can I get an if statement to execute based on number of lines in a file? | LordJezo | Shell Programming and Scripting | 6 | 05-14-2004 11:50 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
searching and storing unknown number of lines based on the string with a condition
Dear friends, Please help me to resolve the problem below,
I have a file with following content: date of file creation : 12 feb 2007 ==================== = name : suresh = city :mumbai #this is a blank line = date : 1st Nov 2005 ==================== few lines of some text this text could be of any number of lines ==================== = code : 10 = time : 10AM = job : dev ==================== ==================== = name : mahesh = city :Bangalore #this is a blank line = date : 1st april 2005 ==================== few lines of some text this text could be of any number of lines ==================== = code : 0 = time : 11AM = job : test ==================== ==================== = name : Girish = city :Pune #this is a blank line = date : 4april 2005 ==================== few lines of some text this text could be of any number of lines ==================== = code : 15 = time : 12AM = job : support ==================== #end of file in the above data, it contains 3 records(marked using blue, green and magenta colours). now the problem is, I need to store all the line of a record which is having the "=code : 10" in a file file_10 and "=code : 15" in a file file_15. and if the "=code : 0" then I need to ignore that record and continure with next record till the end of file. Please help me. thanks in advance, swamymns |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|