Convert Fixed Width Text Files to CSV Easily with 'Convert XLS' from Softinterface


Customers
 

convert fixed width text files to csv software, adobe customer

Adobe Systems Inc. Chooses 'Convert Doc'.  A custom site license has been signed by Adobe allowing them to install 'Convert Doc' on their servers.  They will be using it specifically to do Doc to HTML conversions. "We look forward to using your product and potentially working together in the future", Bob Free, Adobe

convert fixed width text files to csv IBM Customer

Great customer service, prompt attention to our requirements and lightening speed development has been my experience with the staff at Softinterface Inc. Within a few hours of installing... Bruce King, IBM Canada, Toronto, Ontario


Click for the BBB Business Review of this Computers Hardware, Software & Services in Santa Monica CA

no viruses


You need to convert from

Fixed Width Text File to XLS

Fixed Width Text File to XLSX

Fixed Width Text File to CSV

Fixed Width Text File to HTML/XML

CSV to XLS

CSV to XLSX

CSV to HTML/XML

CSV to Fixed Width Text (ASCII/ANSI/Unicode)

Others   

Convert Fixed Width Text to CSV Files

(Batch Conversion of Fixed Width Text Files to/from XLS, CSV etc.)

English, Deutsch, Franįais, Italiano, 日本語, Brazilian Portuguese, Espaņol, Other Languages

'Convert XLS'  Used to convert Fixed Width Text Files to CSV

Do you need software to Convert Fixed Width Text Files to CSV?  If the answer is yes, then we have just the tool you need. Simply specify each column width, character to pad with and left or right alignment (justification) for each column with our built in fixed width text profile editor. Managing multiple fixed width text profiles is easy. We store each profile in a simple text file for easy archiving, manual editing etc.

'Convert XLS' can convert Fixed Width Text Files to CSV (as well as HTML, XML, XLS) extremely fast and it does not require any other software to be installed. Converting the other way, that is from CSV to a fixed width text file is also possible.

Note: We can handle HUGE text file sizes (gigabytes) without a problem. Unicode and other text encodings (ASCII, ANSI, UTF8 etc.) are supported.

All of our conversion tools allow you to automate the process by using the built in scheduler, command line (batch files, command prompt etc.), or for you programmers a COM/ActiveX interface.

Download 'Convert XLS' a tool which can be used to convert Fixed Width Text Files to CSV

See the bottom of this page for some examples showing how to convert fixed width text files to CSV from the command line.

Convert Fixed Width Text Files to CSV with the User Interface

'Convert XLS' video, showing how to convert Fixed Width Text Files to CSV 

Fixed Width Profile Editor (click to enlarge)

Converting From Fixed Width Text file to a CSV file

1.  Select the Convert Files Action To Do

2. Select the input file path. For a whole folder be certain to use the *.ext format.  For example if you want to convert the folder of txt files located in “C:\input folder\” then use “C:\input folder\*.txt”.

     Choose the Convert XLS conversion method.

     Specify the input file format.  In this case it may be "Text (ASCII), Fixed Width (*.TXT)" or for Unicode "Text (Unicode), Fixed Width (*.TXT)".

    Click on the Options button and then the Converting to/from a Fixed Width Text File tab and specify each column width for the input file.

3.  Now specify the output file path. If you are doing a whole folder, then specify the whole folder using the “*.ext” format (for example "c:\output\*.csv").  Finally, specify the ‘Convert To File Format” target (output) file type, in this case it may be one of two choices, “[6] Character Separated (*.CSV)” or if using Unicode “[23] Character Separated Unicode (*.CSV)”. 

4. Click the CONVERT button on the tool bar to start converting.

 

Converting To Fixed Width Text file from a CSV file

1.  Select the Convert Files Action To Do

2. Select the input file path. For a whole folder be certain to use the *.ext format.  For example if you want to convert the folder of xls files located in “C:\input folder\” then use “C:\input folder\*.xls”.

     Choose the Convert XLS conversion method.

     Specify the Original File Format.  In this case it may be one of two choices, “[6] Character Separated (*.CSV)” or if using Unicode “[23] Character Separated Unicode (*.CSV)”. 

    Click on the Options button and then the Converting to/from a Fixed Width Text File tab and specify each column width, pad character, and alignment for the output file.  Also, choose the sheets from the input file(s), ranges and whether to include values or 'formulas and values' to convert.

3.  Now specify the output file path. If you are doing a whole folder, then specify the whole folder using the “*.ext” format (for example "c:\output\*.txt").  Finally, specify the ‘Convert To File Format” target (output) file type, in this case it may be "[21] Text (ASCII), Fixed Width (*.TXT)" or for Unicode "[42] Text (Unicode), Fixed Width (*.TXT)".  Note that you will have more choices available if you choose the ‘MS Excel’ conversion method.

4. Click the CONVERT button on the tool bar to start converting.

 

 

Command Line Examples: Conversion of Fixed Width Text To CSV

NOTE: 'Convert XLS' can be used simply with the graphical user interface (GUI).  If you've never heard of 'Command Line' before, we would recommend not reading this section and instead download and try the software.

This is just a sample from the documentation.   If you have trouble running these examples please see Using the Command Helpful Hints For Creating a Command Line within the documentation.

 

The first example shows how to convert from a fixed width text fileFixed_Width_Text_File_Defined to a character delimited CSVCSV_File_Definition file.  We also show how you can specify a range to convert a portion of the input text file.

Converting from a fixed width text file to anything can only be done with the ‘Convert XLS’ conversion method (/M2). 

All the examples below use an 8 bit ANSI/ASCII text file for the Original/input file. To convert Unicode text files, simply swap out /F21 with /F42 in the examples.

Each switch shown in blue is described in detail below the examples given. It is highly recommended you review each switches description before implementing the example, thereby giving you the full power of ‘Convert XLS’.

Example 1: Convert a Fixed Width Text File To CSV

First specify your fixed width text profile (column widths) using the Using the Fixed Width Text Profile EditorUsing_the_Fixed_Width_Text_Profile_Editor and name your profile MyColWidths. To convert a fixed width text file (c:\in\input.txt) to a comma delimited (ASCIIASCII_Chart value of 44) CSV file c:\out\out.csv using the MyColWidths profile the following syntax would be used:

ConvertXLS.EXE /S"C:\in\input.TXT" /T "C:\out\out.csv" /C6 /F21 /M2 /N"^^44^2^MyColWidths" /V

To convert to a tab delimited (ASCIIASCII_Chart value of 9) simply change the 44 to a 9 in these examples.  In fact you can use any character you want to delimit the output CSV file. 

Next we show how to convert a whole folder (and subfolders /R) of text files (C:\in\*.txt) to CSV files located in the same folder.  The following syntax would be used for such a case:

 

ConvertXLS.EXE /S"C:\in\*.TXT" /T "C:\in\*.CSV" /C6 /F21 /M2 /N"^^44^2^MyColWidths" /R  /V

 

The /G switch can be used to tell ‘Convert XLS’ to simply place each output file in the same folder as each input file. Therefore the command line above is equivalent to the command line below:

 

ConvertXLS.EXE /S"C:\in\*.TXT"  /G /C6  /F21 /M2 /N"^^44^2^MyColWidths" /R  /V

 

You may simply want to convert a whole folder and its subfolders and place the output into a separate folder/drive. In which case use this syntax:

 

ConvertXLS.EXE /S"C:\in\*.TXT"  /T "C:\Out\*.CSV"  /C6 /F21  /M2 /N"^^44^2^MyColWidths" /R  /V

 

Building on the last example, say you want to specify a range, say A1:B10 within a text file to convert. No problem, simply modify the /N switch as shown below:

 

ConvertXLS.EXE /S"C:\in\*.txt"  /T "C:\Out\*.csv"  /C6 /F21  /M2 /N"^A1:B10^44^2^MyColWidths" /R  /V

 

Specifying ranges can be very powerful.

 

·          The /S and /T switches above specify Source (input) and Target (output) path respectively and are both required when converting a single file.  It is always a good idea to use double quotes around the path especially if there are space characters within the path.

·          The /C6 switch specifies that the target (output) file to be CSV file whereas the /F21 switch specifies the original (input file) is a fixed width text file.  See Excel Conversion File Type Constants for all possible values for /C and /F.

·          The /M2 switch tells it to use the ‘Convert XLS’ conversion method which is exceptionally fast and allows for the specification of each columns width. /M1 switch is used to specify the ‘MS Excel’ conversion method which is a bit slower and requires MS Excel. You MUST use /M2 in these examples.

·          The /R switch tells it to search the original folder and its subfolders for files to convert.

·          /G switch can be used to tell ‘Convert XLS’ to place each output file in the same folder as each input file.

·          /N"{Sheet^Range^DelimChar^FixedWidth^Profile}"  Is used when converting to/from an Excel, CSV or fixed width text file. It specifies which Sheets to convert, what Range to convert and what delimitation/separation character to use, and the method to import export to a fixed width text file.  The syntax for this parameter is critical, the items are separated by a carrot character "^".  If you do not include Sheet, Range or DelimChar by leaving them blank they will default to all sheets, all used ranges and the comma delimitation character.  Be certain to include the double quotation character around this parameter.

Sheet:  Not useful in these examples.  Use "*" or "" for all sheets. You can use names of sheets, or the numeric index. If using numeric indices, you can specify ranges of sheets (i.e. "1,4,10-20" and "4-10,9" etc.).

Range: You could optionally specify a range; say if you only wanted to convert a portion of the input file.  Use the same syntax as an Excel range (e.g. A1:B10, B:B).  Once converted to an XLS file, you could then use special process 101 to move the data to any cell range.

DelimChar: Not useful in these examples. It is for specifying the ASCII value of the delimitation character used in a CSV file. 44 for comma, 124 for Bar “|”, 9 for the tab etc.

FixedWidth:  ‘Convert XLS’ Conversion Method only (/M2).  Here you can specify how to import/export a fixed width text file.  The following numeric values are valid:

  0 = Auto size column widths to fit all data (Default)

  1 = Use same widths as specified in the Excel file

  2 = Use widths specified by the Profile.  Widths can be specified in the user interfaces Fixed Width Text Profile Editor.

Profile = If you are specifying a fixed width text profile to use do it with this parameter. Use the Fixed Width Text Profile Editor to generate a profile. The full path to the txt file could be used. As an example if you want to specify to convert sheets called ‘Apples’ and ‘Oranges’, and use the range “A2:B20” and a fixed width text file profile named MyColWidths you would do so like this:

/N"Apples,Oranges^A2:B20^^2^MyColWidths" 

·          The /V (for Verbose) switch is used to give instant feedback by having the program report the status of the conversion with a message box.  You can remove this once you have perfected your command line specification.  You can also (or instead of /V) create a Log file that will contain the results of the conversion by using the /L switch.

Note: It is highly encouraged that you use the Verbose (/V) switch initially to see what the status of your conversion is and to help you perfect your command line.  When in verbose mode the program will tell you what went wrong or right with your command line using message boxes.