fork download
  1. #!/bin/bash
  2. s=$(echo -e 'smith;pete;he is very nice;1990\r\nbrown;mark;he is very nice;2010\r\ntaylor;sam;he is\nvery nice;2009\r\n')
  3. #echo "$s" | sed ':a;N;$!ba; {s/\(\r\n\)|\n/\1/g}'
  4. echo "$s" | sed ':a;N;$!ba;s/\r\n/<<<CRLF>>>/g;s/\n/ /g;s/<<<CRLF>>>/\r\n/g;'
  5.  
  6.  
Success #stdin #stdout 0s 4528KB
stdin
Standard input is empty
stdout
smith;pete;he is very nice;1990
brown;mark;he is very nice;2010
taylor;sam;he is very nice;2009