![]() |
|
|
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 |
| Can I create a file from the command line | airon23bball | Shell Programming and Scripting | 5 | 10-21-2008 03:23 AM |
| find and replace command in one line using one command | vasikaran | UNIX for Dummies Questions & Answers | 10 | 08-20-2008 11:40 AM |
| assign a command line argument and a unix command to awk variables | sweta_doshi | Shell Programming and Scripting | 0 | 08-08-2008 07:54 AM |
| how to? launch command with string of command line options | TinCanFury | Shell Programming and Scripting | 5 | 04-28-2008 07:06 PM |
| add data from command line to end of file | bryan | UNIX for Dummies Questions & Answers | 3 | 05-23-2006 07:57 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
File mgt: Do you know the command line command
I need a commnad to modify a file's contents from:
2009-06-18 14:14:38 CST INF Thread-114 rlo.aaf_ - MASSHANDLE: Got a valid message<Location=""><bob>2</bob><carol>61</carol><ted>54</ted><alice>1m</alice> to this : 2009-06-18 14:14:38 CST INF Thread-114 rlo.aaf_ - MASSHANDLE: Got a valid message<Location=""><bob>2</bob> <carol>61</carol> <ted>54</ted> <alice>1m</alice> Adding the CR (\n) after each </*> and preserving the contents of each field. Thanks for any help! |
|
||||
|
Code:
my $str='2009-06-18 14:14:38 CST INF Thread-114 rlo.aaf_ - MASSHANDLE: Got a valid message<Location=""><bob>2</bob><carol>61</carol><ted>54</ted><alice>1m</alice>'; $str=~ s/(<\/[^>]*>)/$1\n/; print $str; |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|