Skip to content

hymkor/richcsv2poor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rich-CSV to awk-readable-CSV converter

This program replaces delimiters:

  • Replacing , not enclosed with double-quotations to \v (Vertical Tab)
  • Replacing \n (Line Feed) not enclosed with double-quotations to \f (Form Feed)
  • Removing double-quotations

Example

demo.csv:


"NEWLINE <
> FIELD",1
"COMMA <,>",2
$ ./richcsv2poor demo.csv | gawk 'BEGIN{ FS="\v" ; RS="\f" } { printf "%d: [%s]\n",$2,$1 }'
1: [NEWLINE <
> FIELD]
2: [COMMA <,>]