LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  CSV File With Extra Comma at the End of Each Line

    Employee
    Posted 11-21-2014 04:44

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: dstacey

    Hi,

    This may be an easy one - I am trying to import a CSV file that has an extra comma on the end of each line i.e the file looks like this

    Test,Max,
    3,6,

    instead of this

    Test,Max
    3,6

    When I try to import the former using the CSV File Node I get the error "Field 3 on output has a zero-length or all whitespace name." Of course when I try to input the latter everything works fine.

    Any ideas how to overcome this - I've also tried using the Delimited File node but with no luck.

    Thanks,
    Dave


  • 2.  RE: CSV File With Extra Comma at the End of Each Line

    Employee
    Posted 11-21-2014 07:26

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ejones

    I've seen this before. The problem is that the header says to expect only two fields but then each record looks like it has three.

    What I did to get around the error is use the FieldNames parameter on the Optional tab to give this last field a name. In the case you described, the value I'd put in FieldNames would be:
    Test,Max,Dummy

    Then this causes the header row to be read in like data so I used a Split node to filter out the header record. You could use something like this in a filter to get rid of that header row:
    where execCount <> 1
    And at the same time, that filter could also:
    exclude Dummy