cat -e file.txt
gives:
{"yellow":"mango"}^M$
^M$
{"yellow":"banana"}^M$
^M$
{"yellow":"blabla"}^M$
^M$
and I would like to just have:
{""yellow":"mango"}^M$
{"yellow":"banana"}^M$
{"yellow":"blabla"}^M$
in place for all files with txt extention in folder. So I tried:
find . -type f -name "*.txt" -print0 | xargs -0 sed -i "s/^M$^M$/^M$/g"
to no avail. Does anyone have a better idea?
head -n 3 file.txt | od -bc
yields:
0000000 173 042 171 145 154 154 157 167 042 072 042 155 141 156 147 157
{ " y e l l o w " : " m a n g o
0000020 042 175 015 012 015 012 173 042 142 141 142 141 142 042 072 042
" } \r \n \r \n { " b a b a b " : "
0000040 155 141 156 147 157 042 175 015 012
m a n g o " } \r \n
0000051
this:
awk 1 RS='\r\n' ORS= < file.txt
removes the new lines completely (so it's not good: I want to keep one of the successive two on each line, but it does something).