csvCropCSVFileCols

Description: This method allows you to crop or remove certain columns while keeping others. Those not specified will be removed. For example to keep columns 4-20, 25, and 30 specify: "4-20,25,30" for the sColsToUse parameter.

Parameters:

csvCropCSVFileCols(sInputFile As String, sOutputFile As String, sColsToUse As String) As Long

Parameter

Meaning

sPathOriginal

CSV file to use as the original.

sPathTarget

Can be same as sPathOriginal, in which case sPathOriginal will be modified. If a different name is specified, XLSConverterX will create a new file and leave sPathOriginal untouched.

sColsToUse

Selection of columns to keep within the CSV file. All others will be discarded. For example to keep cols 4-20, 25, and 30 specify: "4-20,25,30" 

Return Values:

0: Success 

-2: "Unable to open or save to target file. Could be a sharing violation, or invalid file type. 

-3: "Unable to open original file. Check file format. Could be a sharing violation. 

-201: "Shareware has expired"

Example Code:

Please review the code sample under csvChangeDelimitationCharacter()