BACKGROUND:
The attached tool will take a list of files and read only the firsts record of each. It does not parse the data, just grabs the header. You can then do additional filtering downstream. You may also be able to use the output from that to coerce your column names with the CSV / Delimited "Use FieldNames (from field)" parameter. It was developed by Stony Smith of our Professional Services team.
USE CASE:
A user is having an issue with the "CSV/Delimited Input" node which is configured with "Format=AutoDetect" and "DetectOnly=True". With this configuration, the node is outputting data to a third pin created with the format of each file found, including a "FieldNames" field containing a delimited list of fields found in the file. The issue is that if a file has an apostrophe ( ' ) in the field name and the node errors out with something similar to this:
Error occurred while attempting to open output (0) : "output cause: Reserved character (') on metadata field (17), name: Int'l Plan, type: class com.lavastorm.lang.UnicodeString. "
As a second option, you could insert a do / while that reads one file at a time as a flat file, parses the first record, ignores the rest, and removes the special character, but then the other features of the CSV node are lost, for example; detecting the delimiter and escape characters.
Comments
0 comments
Please sign in to leave a comment.