Working with “Header-less” files

March 21, 2018

Working with “Header-less” files

Many times we have a data file with no column headers.  Sometimes we have a layout of the file that includes the column names.  How to merge the two, so that you have column headers without having to type them in.
 

Assume you have two files:

Your data file looks like this (notice, there is no header row)

Above is the data.txt dataset

 

Your file layout looks like this:

Above is the layout.txt dataset

Step 1:  Import both files to the Library separately.
IMPORTANT: be sure to set the “Number of Header Rows” on import to 0 (zero).
Step 2:  Create a project using the layout.txt dataset

 

Step 3:  Using the Shape: Transform, rotate the data so that Column (0) is in the rows section of the Transform  (if your column names are not listed vertically, but horizontally instead, skip this step)

Your data preview should look like this (notice the column names):

Step 4:  Create a filter selecting all rows, and choose Remove rows from the left-hand navigation bar and click Save.  Optionally, remove any unwanted columns.  Your project will now show a data preview with no rows.

 

                   

                   Step 5:  Append the data.txt dataset to your project.  Here you can align                                          the columns in the data.txt to the column headers in your project.

When finished, the data from data.txt will be aligned with the correct column names as defined by layout.txt

Show Buttons
Hide Buttons