"Fossies" - the Fresh Open Source Software Archive

Member "brlcad-7.32.4/doc/notes/csv_to_comgeom.txt" (29 Jul 2021, 788 Bytes) of package /linux/misc/brlcad-7.32.4.tar.bz2:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 These are some notes about using text manipulation tools to try taking the csv
    2 text files from GCI's transcription work and formatting them as comgeom files.
    3 I don't think they're fully working as yet, but certainly they are a starting
    4 point.
    5 
    6 tr "\r" "\n" < in_raw.csv > in.csv
    7 
    8 Solid table:
    9 
   10 awk -F, 'BEGIN {widthlist = "3 3 10 10 10 10 10 10 10"; split (widthlist, widths, " ")}{for(i=1;i<=NF;i++){printf "%-*s", widths[i],$i};printf "\n"}' in.csv
   11 
   12 Region table:
   13 awk -F, 'BEGIN {widthlist = "5 2 5 7 7 7 7 7 7 7 2 5 10"; split (widthlist, widths, " ")}{for(i=1;i<=NF;i++){printf "%-*s", widths[i],$i};printf "\n"}' in.csv
   14 
   15 Ident table:
   16 awk -F, 'BEGIN {widthlist = "10 10 10 43 3 3"; split (widthlist, widths, " ")}{for(i=1;i<=NF;i++){printf "%-*s", widths[i],$i};printf "\n"}' in.csv
   17