Options

Dataport : Break exported dataset into several files of 2MB each

Hi guys, :smile:

I'm working with NAV Classic , I'm exporting data with a dataport, I need it to export data but break the data into .txt files of 2MB each. Lets say and full export would be 10MBS, this should be exported as 5 files of 2MB each.

Please help.

Answers

  • Options
    BeliasBelias Member Posts: 2,998
    edited 2016-02-12
    The most straightforward solution is to create the entire file, check his LEN and split it into files of 2048 len.
    Things to keep in mind:
    - every time you use the WRITE instruction in your code, you write a line followed by crlf...consider 2 additional bytes every WRITE instruction (plus one byte per character).
    - i assume you will write the files with TEXTMODE(TRUE). in this case, numbers are treated as text, otherwise they are written as numbers and they occupy 4 bytes. (check WRITE funciton in the help file)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.