Export several dataports to one file

ASTAST Member Posts: 108
Hello,
It is possible to export several dataports to one file? I mean append lines of text at the end of existing file.
Pleas help, I really need this.

Comments

  • Steve.DesmedtSteve.Desmedt Member Posts: 13
    I don't think it's possible.
    What you can do is to make two files and write some procedure to merge them.
  • SavatageSavatage Member Posts: 7,142
    edited 2007-11-21
    Actually Adding Text at the end of an already existing text file IS POSSIBLE.

    I haven't looked into it in depth, but We use Lanhams EDI module. And when I EXPORT a sales order to a text file, if I don't delete the previous text file then the two outputs are combined.

    I think this happens in the Sales order Export Codeunit 14000354.
    Possibly in the OpenEDIFile Trigger.
    I believe it opens the file uses the Functions SEEK & TRUNC to find the file length & start writing at that point. There seems to be alot of
    BegPos (Beginning Position) &
    BeginFileLength going on :whistle:

    Perhaps one of the Mega Gurus can look into the basics of how it is done - it would make a good tip n trick.
  • ssinglassingla Member Posts: 2,973
    If excel format helps then you can use the update functionality of export to excel as used in analysis by dimension. Here you can specify the excel file and the sheet number to transfer the data.
    CA Sandeep Singla
    http://ssdynamics.co.in
  • MalajloMalajlo Member Posts: 294
    Try DOS feature type >> file.ext
    1) export to first txt
    2) export to second txt
    3) append contents of second txt into first txt
    type second.txt >> first.txt
    

    Result will be contents of first.txt plus second.txt in file first.txt.
    If you'd like to add separator (new line), create i.e. NLCR.txt with single <LF><CR> and then
    type nlcr.txt &gt;&gt; first.txt
    type second.txt >> first.txt
    
  • Palle_Due_Larsen_[MFST]Palle_Due_Larsen_[MFST] Member, Microsoft Employee Posts: 3
    Another command prompt possibility is copying with "+". If you do:

    copy file1.txt+file2.txt+file3.txt file4.txt

    the three files will be concatenated into file4.txt. That way you only need on command line.
    Palle Due Larsen, Microsoft NAV
    This posting is provided "AS IS" with no warranties, and confers no rights
Sign In or Register to comment.