Hi,
I have similar to the following text :
I would like this[Unloading randomclass1]
[Unloading randomclass2]
[Unloading randomclass3]
[Unloading randomclass4]
to be a single sentence
I need to end up with :
I would like this to be a single sentence
There number of lines between the required parts is unknown as is the text (it differs from line to line)
What I have so far is this :
sed '/Unloading/{
N
s/\[Unloading.*\n//g
}' somefile
But all this gives me is :
I would like this[Unloading randomclass2]
[Unloading randomclass4]
to be a single sentence
because it doesn't re-process the line again once it has brought the next line up.
Any sed Guru's who may be able to help ?
Thanks,
Matt.
I have similar to the following text :
I would like this[Unloading randomclass1]
[Unloading randomclass2]
[Unloading randomclass3]
[Unloading randomclass4]
to be a single sentence
I need to end up with :
I would like this to be a single sentence
There number of lines between the required parts is unknown as is the text (it differs from line to line)
What I have so far is this :
sed '/Unloading/{
N
s/\[Unloading.*\n//g
}' somefile
But all this gives me is :
I would like this[Unloading randomclass2]
[Unloading randomclass4]
to be a single sentence
because it doesn't re-process the line again once it has brought the next line up.
Any sed Guru's who may be able to help ?
Thanks,
Matt.