[vox-tech] CSV with rogue EOLs

David Hummel vox-tech@lists.lugod.org
Thu, 16 Oct 2003 18:46:49 -0700


On Thu, Oct 16, 2003 at 06:24:32PM -0700, Bill Kendrick wrote:
> Has anyone got a Perl or sed script handy that can take a CSV
> (comma-separated values) text file like this:
> 
>   "1234","Hello","ABCD"
>   "1235","Hello
>   there","XYZ"
>   "1236","Goodbye","LLLL"
> 
> and make it look like this:
> 
>   "1234","Hello","ABCD"
>   "1235","Hello there","XYZ"
>   "1236","Goodbye","LLLL"

This works but is very basic:

---
#!/usr/bin/perl -p
unless (/\"$/) {chomp;$_.=' ';}
---

David Hummel
Genomics & Gene Discovery
WRRC/ARS/USDA