Hi,
I'm trying to insert double quotes right after the third delimiter in a file. Delimiter is ^Z.
For example:
Input:
Oct ^Z 1234 ^Z John ^Z Hello!"
Desired Output:
Oct ^Z 1234 ^Z John ^Z "Hello!"
Any ideas?
Hi,
I'm trying to insert double quotes right after the third delimiter in a file. Delimiter is ^Z.
For example:
Input:
Oct ^Z 1234 ^Z John ^Z Hello!"
Desired Output:
Oct ^Z 1234 ^Z John ^Z "Hello!"
Any ideas?
Try this:
sed 's/\(.*^Z\)/\1"/' inputfile > outputfile
I'm presuming you added the spaces around the delimiters for clarity? If not, Just add a space after the Z in the sed script. I'm also presuming that the fourth field is the last field on the line.