Import txt Files more than 1 lines

bangswitbangswit Member Posts: 265
hi all...
if we want to import txt file using dataport but I have more than I lines
how do i import that?
this is the sample data :
SHR ED 93AEAN007ORDERS0
HDRORDERS E1020

this is 1 record
I'm using fixed format dataport
I confused about StartPos

Comments

  • kinekine Member Posts: 12,562
    You cannot do it through dataport in standard way. You will need to read it line by line and parse it yourself. But you can use codeunit for reading the file too... Dataport is not able to read more lines as one record and parse it automatically...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • bangswitbangswit Member Posts: 265
    codeunit???
    do you have sample like that?
  • kinekine Member Posts: 12,562
    bangswit wrote:
    codeunit???
    do you have sample like that?

    Using FILE data type variable to read the file... you know how to use FILE data type, aren't you? ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • bangswitbangswit Member Posts: 265
    kine wrote:
    bangswit wrote:
    codeunit???
    do you have sample like that?

    Using FILE data type variable to read the file... you know how to use FILE data type, aren't you? ;-)
    no i don't
    sorry newbie :p
  • bangswitbangswit Member Posts: 265
    I already create codeunit
    but how to set up start pos and width like in dataport?
    and what is the code for ENTER ??
    i use ascii code no 13
    but the result is like this (the bold one) --> SHR|PARTNER1|E1|1|ORDERS|Test|1|2|3|4|5|6|6|||
  • kinekine Member Posts: 12,562
    You need to use TextMode on the file...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.