svleeuwen
5/6/2014 - 11:30 AM

Find and replace line-endings of file with sed

Find and replace line-endings of file with sed

# in place
sed ':a;N;$!ba;s/\n/ /g' source_file.sql -i

# to file
sed ':a;N;$!ba;s/\n/ /g' source_file.sql > target.sql

# with parentheses
sed ':a;N;$!ba;s/)\n/);\n/g' source_file.sql -i