VERTICLE


PURPOSE   OPERATION   COMMAND LINES   OPTIONS   RELATED PROGRAMS


Author: Dan Mares, dmares @ maresware . com
Portions Copyright © 2014-2021 by Dan Mares
Phone: (678)427-3275
Last Update: 03/22/2020

One liner: Takes multi-field "horizontal" report and turns into multi-line report for easy review.

This is a command line program.
MUST be run within a command window as administrator.


Purpose

This program was designed to work with pipe or tab delimited files where each line is a separate record.

Then it takes the field in each "horizontal" record and places that field on a line by itself. This allows the program to take a very long "horizontal" data line, and convert it to a number of individual "verticle" lines. Each line consisting of the data within each separate field.

This way, the new output file can be easily inserted into a report that even a manager can read, and instead of having "wide" records with multiple columns that span the width of the screen or print line, you have a single line for each field.

It makes inserting into a report much cleaner than trying to insert a wide spreadsheet type item. If you have a few, or many records, the fields within each record now shows up as seperate lines. See the sample data records here, and their new format after running thru the program. Note, all fields MUST be tab delimeted. Spaces used here for simplicity.

Also: with adaption of the -h (for HTML) option, the program will take the same input file, and create an HTML output file with appropriate htm header and footer. This allows the user to open the output file with the web browser.

Before:
 
Email_Message_ID Name  Date       To:       From:          Subject 
001              Dan   6/24/2012  Anyone    nobody@att.net try this out
002              Mary  6/28/2012  Noone     nobody@att.net try this 2nd line 
003              Husky 6/21/2012  Everyone  nobody@att.net try this 3rd record 
Suppose these fields were very long, and run off the screen. It would be inconvenient to insert to a report. But after the process, see how each record now looks. After:
Email_Message_ID  001
Name     Dan
Date     6/24/2012  
To:      Anyone       
From:    nobody@att.net      
Subject: try this out

Email_Message_ID  002
Name     Mary
Date     6/28/2012  
To:      Noone       
From:    nobody@att.net      
Subject: try this 2nd line

Email_Message_ID  003
Name     Dan
Date     6/21/2012  
To:      Everyone       
From:    nobody@att.net      
Subject: try this 3rd record
It is designed to take as input, a tab or pipe delimeted file which has as its first record the header fields of the record, and each succeeding record has the approriate tab delimeted fields.

It then creates an output file with seperate lines for each field within each record. Each line, is preceeded with the appropriate header value.


Top

Operation

This program takes a single filename as its input. The file MUST be tab or pipe (|) delimeted. The first row is assumed to be the column or field headers.

Each succeeding record/row is itself a delimeted record.

The program takes the input filename, parses the header row to determine each field's name. Then reads each row in turn. It parses each row, and places on a single line, the appropriate header, and its value from the record it read.

It continues to read and parse records until the end of the file. Short lines of less than 10 characters are ignored. This allows for errors in the input file.

The output file contains all the information in the input file, but formatted differently. Hopefully, easier to insert records into a report and make it easier for users to read individual data fields from the records.

The output file is the same name as the input, but has an extension of .VT for "verticle", or .HTM for the HTML file formatted output. Any existing output file of the same name, is overwritten.


Top

Command Lines

C:>   verticle    inputfilename.ext
C:>   verticle    inputfilename.ext -d "|"
C:>   verticle    inputfilename.ext -d "|" --seq
Output file has a new extension:   resulting in an output name of: inputfilename.VT

C:>   verticle    inputfilename.ext -d "|" -h
Output file has a new extension of .HTM:   resulting in an output name of: inputfilename.HTM for browser viewing.

Top

Options

-d "|": The input file uses a pipe as delimeter instead of a tab

-h: The output file is an HTML browser compatable file.

--TRU: TRUNcate (upper case) any trailing blanks in either the header item, or data item.
         This is useful when there is a lot of trailing spaces in either the header or data.

--seq: Insert a record/sequence # before each item in the output.


Related Programs

X_Ways_meta_processing    which also contains information on x-ways_report_process operations.

CSV2PIPE  Is capable of removing embedded carriage returns from csv files.

Top