New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to handle fixed width text files with no header rows #6

Closed
mrandrewmills opened this Issue Jan 4, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@mrandrewmills
Copy link
Owner

mrandrewmills commented Jan 4, 2015

Toolkit assumes first row of the file is always the header row. If you stumble across a file that doesn't have a header row, it might be nice to toggle a property in the class (e.g. hasHeaderRows) to false, and have the toolkit do something like this:

  1. if header rows are absent, use first row to get number of columns, start and stop positions, etc.

  2. "drop in" default field names (e.g. Column 1, Column 2, etc.)? Or give developer a method for modifying/overwriting the field names? (May need to think this out in more detail.)

  3. when reading data, make sure to go back and treat the first row as data instead of ignoring it as a previously read header row.

@mrandrewmills

This comment has been minimized.

Copy link
Owner

mrandrewmills commented Jan 11, 2015

added property hasHeaderRow (boolean) to code, modified data reading functions to handle their tasks differently based on value of that property.

NOTE: this script still assumes you have header rows by default. If you do not, you will need to specifically inform the script by setting the hasHeaderRows property to false BEFORE telling it the location of the data file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment