Dataport ques-how to skip the header line when import?

rolandroland Member Posts: 36
edited 2004-03-05 in Navision Attain
Hi all,

I have a text file in csv for import. However, the first line of the text file is the headers for the fields. Is there a way to skip the first line when I run import in the Dataport?

Thanks!

Comments

  • eromeineromein Member Posts: 589
    sure... two ways:

    1.) Delete first like from file, or better... make sure that first line isn't exported.

    2.) Create a Integer dataitem as the first dataitem. Difine a dummy variable and use this to import all header fields. Make sure you loop this integer dataitem only ones.
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • rolandroland Member Posts: 36
    Dear eromein,

    Thank you! It's working now :D
  • DenSterDenSter Member Posts: 8,307
    you can also import data with a codeunit. You'd only have to write code to parse the lines, and I also think the line length is limited to like 1000 characters or something. Other than that, using a codeunit can enable you to have a file with both header and line information in one file.

    You can also use the CG codeunits and import your data out of XML documents.
Sign In or Register to comment.