CSV2PIPE

PURPOSE   OPERATION   OPTIONS   COMMAND LINES   RELATED PROGRAMS  


Author: Dan Mares, info @ maresware . com
Portions Copyright © (2009-2021) by Dan Mares
Phone: (678) 427-3275


top

Purpose

CSV2PIPE will process either a csv, tab, or other delimeted file (which is normally exported from a spreadsheet) and do the following:

 

Sample input:

Converted to:


top

Operation

The default operation is to attempt to automaticaly detect whether the file is tab or csv delimeted, and then it creates an output file where the delimeters are converted to pipes.

Without specific options, the only operation that takes place is the delimeters are replaced with pipes.

The major processing takes place when specific options are implemented.


top

Options

Where you see a plus (+) sign, this only means that you must add an item. DO NOT include the + sign itself.
Do not include the colon (:) either. It is used only for display.
Items within [square brackets] are ini file options.

-i + inputfilename:  input file is named this. process thisfile. -i is not required if the command line has the inputfilename as the first item on the command line

-o + outputfilename:  create or write the output to this file. -o is not needed if the outputfilename is the 2nd item on the command line, IMMEDIATELY following the unoptioned input filename

-p:  DO NOT convert the delimeters to pipes. The default is to convert all delimeters to pipes. [PIPE=[ON|OFF]]

-[ccTT]  assume the delimeter in the file is either (c)comma or (t)ab. This forces the program to use this delimeter. Without this option, the program attempts to make an internal check on the delimeter which is used. This option should only be necessar in extreme cases. [comma] [tab] [comma=[on|off] [tab=[on|off]

-d + X:  replace the X with the delimeter. If it is a tab or other non printing character, use the ascii value. IE: tabs are 09. (-d , or -d 09) [DELIMETER=xx]

-[nl]  remove the embedded line feed characters (0x0a) from the record. [NOLF]

-s  Create a seperate output file for each record of the input. The output file names are sequenced from 1000 using the basename of the output filename provided. If outputfilename is junk.out then the sequenced filenames are: junk1000.out, junk1001.out etc. If NO output filename is provided, the sequences are 1000, 1001, 1002 etc.     [SPLIT=[on|off]] [SEPERATE=[ON|OFF]]

-[Hh]  Assumes the first line of the data file is the column header row. This row will be used to format the output records. It can only be used in conjunction with the -s option to create (S)eperate output files. It takes the header row, and adds the item as the left most column, and identifies the row in the output record as the appropriate data element. Because it creates multi-rows of output, you must also use the -r option to cause each field to become a seperate row. For this reason, it is also suggested that the -r be used, otherwise you will get multi rows of header information, but only one row of data. If the -H is used, the -r is automatically inserted (just in case you forgot). This item, and the -r option are only installed with the -s option. But you must always remember to use the -s option. The -s is NOT automatic.

-r  Insert (r)eturns. Instead of changing the delimeters to pipes, create a newline where each delimeter is found. This makes for easier reading of the output files. THIS OPTION IS BEST USED WITH THE -s (seperate output files) so that the outputs are legible.

-m + X:  Set the -s option, and place X numbers of files in each output folder. This -m option automatically initializes the -s also. [MAX=xx]


top

Command Line

C:>CSV2PIPE   (get help screen with options)

C:>CSV2PIPE   inputfile  outputfile

C:>CSV2PIPE  -i inputfile  -o outputfile

C:>CSV2PIPE   inputfile  outputfile  -n  (convert newlines to spaces)

C:>CSV2PIPE   inputfile  outputfile  -p  (DO NOT convert delimeters to pipes)

C:>CSV2PIPE   inputfile  outputfile  -d ,  (delimeter is a comma)

C:>CSV2PIPE   inputfile  outputfile  -c  (comma seperated/delimeted)

C:>CSV2PIPE   inputfile  outputfile  -t  (tab seperated/delimeted)

C:>CSV2PIPE   inputfile  outputfile  -s  (create seperate output file for each record)

C:>CSV2PIPE   inputfile  outputfile  -s  -m 500 (create seperate output files, 500 per folder)


top

Related Programs

NONE

top