![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| make multiple line containing a pattern into single line | VTAWKVT | Shell Programming and Scripting | 13 | 12-04-2008 06:40 PM |
| replacing multiple lines with single line | siba.s.nayak | Shell Programming and Scripting | 3 | 05-28-2008 02:43 AM |
| ls command output in single line | arsheshadri | AIX | 7 | 04-28-2008 02:50 PM |
| Multi-line output to single line | LinuxRacr | Shell Programming and Scripting | 7 | 02-26-2008 10:05 AM |
| Need output in different lines not in one single line | csaha | Shell Programming and Scripting | 1 | 02-08-2006 08:28 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
|||||
|
Without the entire code it would be difficult to debug,
try copy/pasting the code (there is an escaped new line): Code:
zsh-4.3.4% cat file
TCF_Distro,10.10.50.2,WS-C3560-24TS,CAT1050RH3D,AHA,10.10.50.3,WS-C3560-24TS,CAT1050RHT2,TCF,10.10.50.4,WS-C3560-48PS,CAT1026RKD3
zsh-4.3.4% sed 's/\([^,]*,\)\{4\}/&\
quote> /g' file
TCF_Distro,10.10.50.2,WS-C3560-24TS,CAT1050RH3D,
AHA,10.10.50.3,WS-C3560-24TS,CAT1050RHT2,
TCF,10.10.50.4,WS-C3560-48PS,CAT1026RKD3
Code:
zsh-4.3.4% sed -r 's/([^,]*,){4}/&\n/g' file
TCF_Distro,10.10.50.2,WS-C3560-24TS,CAT1050RH3D,
AHA,10.10.50.3,WS-C3560-24TS,CAT1050RHT2,
TCF,10.10.50.4,WS-C3560-48PS,CAT1026RKD3
|
![]() |
| Bookmarks |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|