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}{asdfasdfasdfasdasdfasdfasdfasdfsfasdfasdfasdfsdfasdfasdfasdf}\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 }