![]() |
|
|
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 |
| delete blank space in begining of line | karthikn7974 | Shell Programming and Scripting | 4 | 05-07-2008 05:40 AM |
| move the last word to begining of next line - SED | baskar | Shell Programming and Scripting | 4 | 02-15-2008 12:28 PM |
| Can "sed" substitute word on a specific line? | minifish | Shell Programming and Scripting | 2 | 02-14-2008 05:25 PM |
| grep a word from a specific line | blurboy | Shell Programming and Scripting | 3 | 01-23-2008 04:13 AM |
| transforming a multiline record to single line | anju | Shell Programming and Scripting | 9 | 01-14-2008 07:55 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to merge multiline into line begining with specific word
Hi,
The file format is like the following. timestamp=2008-02-28-23.50.29.550675;category=CONTEXT;audit event=CONNECT; event correlator=2; database=CURDOMS;userid=inst3;authid=INST3; origin node=0;coordinator node=0; application id=AC122081.FA97.054468155029;application name=java; timestamp=2008-02-28-23.50.29.552161;category=CONTEXT;audit event=ROLLBACK; event correlator=2; database=CURDOMS;userid=inst3;authid=INST3; origin node=0;coordinator node=0; application id=AC122081.DA97.054468153551;application name=java; timestamp=2008-02-28-23.50.29.552183;category=CONTEXT;audit event=ROLLBACK; event correlator=2; database=CURDOMS;userid=inst3;authid=INST3; origin node=0;coordinator node=0; application id=AC122081.DA97.054468153551;application name=java; timestamp=2008-02-28-23.50.29.552188;category=CONTEXT;audit event=CONNECT_RESET; event correlator=3; database=CURDOMS;userid=inst3;authid=INST3; origin node=0;coordinator node=0; application id=AC122081.DA97.054468153551;application name=java; timestamp=2008-02-28-23.50.29.557734;category=CONTEXT;audit event=CONNECT; event correlator=2; database=CURDOMS;userid=inst3;authid=INST3; origin node=0;coordinator node=0; application id=AC122081.FB97.054468155031;application name=java; I would like to merge the lines between the "timestamp" to the next "timestamp" into one line. Can someone help me? Thanks Missyou |
|
||||
|
perl:
-->
open FH,"<b"; undef $/; $str=<FH>; $str=~ tr/\n/ /; $str=~ s/timestamp/\ntimestamp/g; print $str; close FH; Code:
open FH,"<b";
undef $/;
$str=<FH>;
$str=~ tr/\n/ /;
$str=~ s/timestamp/\ntimestamp/g;
print $str;
close FH;
|
![]() |
| Bookmarks |
| Tags |
| timestamp multiline |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|