2 Replies Latest reply on Mar 3, 2016 7:51 AM by Jonathan Drummey

    How to add column header labels to a data file in Tableau

    J D

      I'm just starting to use Tableau and want to import a tab separated data file that does not have column headers in the file. I have a separate file with the column headers in the file.

       

      Is there any way to import the column headers after I import the data file or vice versa?

       

      For now, I did a concatenation of the two files in Unix via the cat command but would like to concatenate the files in Tableau if possible.

       

      Thanks

        • 1. Re: How to add column header labels to a data file in Tableau
          Patrick A Van Der Hyde

          JD -  I don't know of a solution within Tableau to add a single row text file to a data file. Even trying to open a single row text file results in error.  Maybe my response will trigger another idea.  Also - what about the cat command process you worked out creates an issue?

           

          Thanks,

           

          Patrick

          • 2. Re: How to add column header labels to a data file in Tableau
            Jonathan Drummey

            Hi Patrick, if you add a newline to the text file then Tableau will be ok with it, and that Null record could be easily filtered out.

             

            I was curious and tried out the 9.3beta UNION functionality using a data set with 2 fields (header1 and header2) that had a newline, and then a couple of rows of data in the data.txt file with no header, here's what happened:

             

             

            Tableau merged the data sets and ended up with 2 rows, so it ignored the Null row from the headers file. I don't think this is a solution because someone would have to manually rename fields or create a calculated field. Doing the work outside of Tableau to concatenate the two files is still the best option, I think.

             

            Jonathan