How to remove Carriage Return (CRLF) within double quotes in a file. There are multiple CRLFs within double quotes. We are on Ubuntu 14.04.2 LTS. Can someone advice with awk or sed script.
Note: command should only remove Carriage Return within Double Quotes
message edited by covina
#!/usr/bin/perl -w
# this script finds a CRLF between double quotes and only removes the CR
open FILE, “./data.txt” or die “Error message here: $!”;
# be advised that in the script above ^M and ^L are actual control-M and control-L characters. To create them in vi press the control-v key combination and press control-m. Repeat the same process for control-L
Or if you just want a perl one-liner to do the job:
perl -wpl -e ‘s/”^M^L”/”^L”/g;’ data.txt > newdata.txt
Let me know if you have any questions.
message edited by nails