YLNScripts: Batch – How to Set Column Text Alignment

I saw a request on TechNet Forum on how to align column text so that the data looks very neat.

I always think that it is very difficult to achieve this on Windows Batch Scripting, so out of curiosity, I somehow successfully wrote this on Batch Script.

YLNotes Scripts File:

S1-1. Download Admin Scripts YLNotes_Batch_ColumnTextAlignment

[ddownload id=”2107″] YLNotes_Batch_ColumnTextAlignment ([ddownload_count id=”2107″])

S1-2. Unzip to the root of the drive

How It Works:

S2-1. The script will load CSV data file and parse with default delimiter (i.e. space) as shown with below sample data

YLNScripts_20150001_0001

S2-2. For each column, we need to set the column parameter on Text Alignment, Column Width and Padding Character. Call Library Script YLNOTES_COLUMN_TEXT_ALIGNMENT which will return result with text alignment.

YLNScripts_20150001_0002

S2-3. The result of text alignment is output as shown below

YLNScripts_20150001_0003

S2-4. If you execute the batch file, the output are as follows:

YLNScripts_20150001_0004

Leave a Reply

Your email address will not be published. Required fields are marked *