Im trying to write a shell script that removes a "newline character followed by a tab" throughout a file. basically it should get rid of it. Here's an example
File Before
The cat sat on the
mat
File After
The cat sat on the mat
This message writing screen has problems showing tabs but basically there is a tab character before the word mat. THe shell script should loop through the entire file and find and replace all occurences of new line follwed by tab with nothing.
Does anyone know how to write a shell script to do this?
i stole it from handy one-liners for sed. the problem was similar to the example of a line that begins with an equal sign (sed -e :a -e '$!N;s/\n=/ /;ta' -e 'P;D')
-e cmd
Next argument is an editing command. Useful if multiple scripts or commands are specified.
:label
Label branched to by t or b.
b
Branch to label or to end of script.
t
Same as b, but branch only after substitution.
P
Print first part (up to embedded newline) of multiline pattern space created by N command. Same as p if N has not been applied to a line.
D
Delete the first part (up to embedded newline) of multi-line pattern space created by N command and resume editing with first command in script. If this command empties the pattern space, a new line of input is read, as if the d command had been executed.