Results 1 to 6 of 6

Thread: File Export

  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have four queries that need to end up in the same text file.
    Query one creates the Header record of the file. It has a specific Fixed Width file layout.
    Query two creates the Master records for the file and has it's own Fixed Width file layout.
    Query three creates the Detail records, and again has a diferent Fixed Width layout.
    Query four is for the Trailer record with a fourth Fixed Width layout.

    What is the best way to get these four recordsets, with their individual file layout, into a single text file?


    Thanks for any help.
    Richard

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    [quote name='Aheron' post='785060' date='17-Jul-2009 14:03']What is the best way to get these four recordsets, with their individual file layout, into a single text file?[/quote]
    By merging them after creating them, for example:

    Shell "cmd /c ""copy file1.txt+file2.txt+file3.txt+file4.txt target.txt"""

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank, I thin this is going to do the trick.
    Richard

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK, maybe this is not not working so well after all.

    Here is the string I am passing to the Shell command. I do not get any errors, but I do not see the final file.

    cmd /c ""Sedgwick_HDR_07212009.txt+Sedgwick_MST_07212009. txt+Sedgwick_DTL_07212009.t
    xt+Sedgwick_TRL_07212009.txt Sedwick_07212009.txt""

    Am I missing something?
    Richard

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    [quote name='Aheron' post='785551' date='21-Jul-2009 23:36']cmd /c ""Sedgwick_HDR_07212009.txt+Sedgwick_MST_07212009. txt+Sedgwick_DTL_07212009.t
    xt+Sedgwick_TRL_07212009.txt Sedwick_07212009.txt""

    Am I missing something?[/quote]

    You are missing the word 'copy'.
    Regards
    John



  6. #6
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, guess spelling counts after all.

    Now the file is there and in the correct directory.
    Richard

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •