"Fossies" - the Fresh Open Source Software Archive

Member "gawk-5.1.0/awklib/eg/misc/test-csv.awk" (14 Apr 2020, 285 Bytes) of package /linux/misc/gawk-5.1.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) (G)AWK source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 BEGIN {
    2      fp[0] = "([^,]+)|(\"[^\"]+\")"
    3      fp[1] = "([^,]*)|(\"[^\"]+\")"
    4      fp[2] = "([^,]*)|(\"([^\"]|\"\")+\")"
    5      FPAT = fp[fpat+0]
    6 }
    7 
    8 {
    9      print "<" $0 ">"
   10      printf("NF = %s ", NF)
   11      for (i = 1; i <= NF; i++) {
   12          printf("<%s>", $i)
   13      }
   14      print ""
   15 }