![]() |
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 |
| need help on containers/zones | upengan78 | SUN Solaris | 14 | 10-10-2008 05:46 PM |
| how to remove all tabs and newline (\n) | pvr_satya | Shell Programming and Scripting | 2 | 08-16-2008 03:38 PM |
| remove trailing newline characters | shweta_d | Shell Programming and Scripting | 7 | 06-05-2007 10:29 AM |
| Raid containers and filesystems | falklandtim | SCO | 1 | 10-13-2005 05:34 PM |
| GRID containers technology | dheram | AIX | 1 | 07-25-2005 10:42 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
If we assume that each line between the {} container is an XML document then What I want to remove the newline character from all lines within each container to have one XMDL document per line I wrote a bit of sed after trawling the web:
e.g. #!/bin/sed -nf H /}/ { x s/\n//g p } This process is not quite behaving how I expect in that some of the lines are mixed up between the containers File before being passed to sed {dwfglsdfsdfsdfsdfsdfsdfsdfsdfsdf\n dgdgdgdgdgdgdgdgdgdgdg\n dfgsdfgsdfgsdfg}\n \n {sdgfsdgggggggggggggggg\n ggggggggggggggggggggg\n gggggggggggggggggggggsdf\n d}\n \n {asdfasdfasdfasd\n asdfasdfasdfasdf\n sfasdfasdfasdf\n sdfasdfasdfasdf}\n \n File after sed (is what I am hoping for with the only \n after the end }): {dwfglsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfdgdgdgdfgsdfgsdfgsdfg}\n {sdgfsdgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsdfd}\n {asdfasdfasdfasdasdfasdfasdfasdfsfasdfasdfasdfsdfasdfasdfasdf}\n what I am getting is: {dwfglsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfdgdgdgdgdgdgdgdgdgdgdg dfgsdfgsdfgsdfg}\n {sdgfsdgggggggggggggggggggggggggggggggggggggggggggggggggsdfd}{asdfasdfasdfasdasdfasdfasdfasdfsfasdfa sdfasdfsdfasdfasdfasdf}\n The lines are long so I would expect wrapping per one line but not to see a container }{ being embedded within a line without a newline after the enclosing } |
| Bookmarks |
| Tags |
| awk, ksh, sed remove newline, unix newline |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|