Data360 Analyze

 View Only
  • 1.  read a delimited file with a mix of columns populated

    Employee
    Posted 09-01-2021 06:08

    Hi 

    I have a file that contains multiple records which are of a differing recordtype. This means that certain record types have more columns than another.

    The delimiter is a pipe.

    I tried to use the delimited node which reads the first record but errors the remaining ones.

    I cant name headers as the first record doesnt have the same as the other records.

    Ultimately I wish to load the whole file and then split on record type which is the first column in the file.

    Any advice appreciated.

    Thanks

    Martin



  • 2.  RE: read a delimited file with a mix of columns populated

    Employee
    Posted 09-02-2021 02:01

    Hi Martin,

    You can configure the CSV/Delimited node to assume each record in the file is a single field (e.g. named 'Data'). You can specify the name for the dummy field in the 'FieldNames' property.

    The node would be configured with a Delimiter character that will not exist in the actual file data e.g. '¬' or a control character '\07'.

    If the file data has a header record this can be skipped by setting the 'SkipHeaderRows' property to a value of '1'.

    Once the data has been imported you can then split the data on the leading characters of the 'Data' field and then use further CSV/Delimited nodes that are configured to source their (pipe-delimited) data from an input field.

    You may also be interested in this article:

    https://support.infogix.com/hc/en-us/community/posts/360028941493-Expanding-a-List-into-Multiple-Columns

     

     

    Attached files

    Read_Records_w_Different_Num_Fields - 2 Sept 2021.lna

     



  • 3.  RE: read a delimited file with a mix of columns populated

    Employee
    Posted 09-02-2021 02:07

    Example Data file used with the example data flow:

     

     

    Attached files

    Pipe_Delim--records_w_Different_Num_Colums.txt

     



  • 4.  RE: read a delimited file with a mix of columns populated

    Employee
    Posted 09-02-2021 07:29

    Many Thanks Adrian this worked a treat! hope you are well!

    I did have multiple prefixes to output so used a superceded transform node to split into multiple output pins

    Martin