Skip to content

fkfest/csvfwf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

14d7514 · Nov 16, 2023

History

25 Commits
Nov 16, 2023
Jun 8, 2018
Aug 23, 2023

Repository files navigation

csvfwf

Create comma-separated fixed-width formated tables from csv files.

Usage:

csvfwf.py <csv-file> > <csv-fwf-file>

-di : define delimiter in the input file

-do : define delimiter for the output

By default the alignment is set to be right unless the entry starts with = or " (otherwise some programs don't recognize the equations or text fields). It can be changed with following options:

-l : align all entries left

-r : align all entries right

-x : compress the csv again, i.e., remove the fixed-format formating

Example:

Input file input.csv:

This is a test file for csvfwf,,
"First column, A","Second, B","Third, C"
Row A,12.34,56.7
Row B,8,12.12
Here is a very long description for the following rows,,
Row C,9.1,13.1415
Here is a short description,,
Here are two descriptions,,second

after running csvfwf.py input.csv > output.csv the output file output.csv contains:

This is a test file for csvfwf,,           ,
 "First column, A", "Second, B", "Third, C",
             Row A,       12.34,       56.7,
             Row B,           8,      12.12,
Here is a very long description for the following rows,,,
             Row C,         9.1,    13.1415,
Here is a short description,   ,           ,
Here are two descriptions,     ,     second,

or after running csvfwf.py -do "|" input.csv > output.csv :

This is a test file for csvfwf||     |
 First column, A| Second, B| Third, C|
           Row A|     12.34|     56.7|
           Row B|         8|    12.12|
Here is a very long description for the following rows|||
           Row C|       9.1|  13.1415|
Here is a short description||        |
Here are two descriptions| |   second|

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages