Results 1 to 3 of 3

Thread: Reading many *.TXT files into one

  1. #1

    Thread Starter
    Addicted Member nota141's Avatar
    Join Date
    Feb 2000
    Location
    The place down there under everyone else.
    Posts
    224

    Thumbs up Thanks

    Thanks HeSaidJoe That worked.

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    Talking <?>

    Welcome
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Member
    Join Date
    May 2000
    Posts
    63
    If I may add to HeSaidJoe's solution...(which by the way is a very good solution!) You could eliminate the array and increase speed and efficiency with a couple lines of code:


    1) open an output file, "new file" before you start reading any of the input files.

    2) Immediately after you do the Line Input statement, add a Print #intOutFile, trim(myLine)

    3) close the output file outside the parent while loop.

    When the last input file is closed and then you close the output file, all your processing is done.

    This would eliminate the array completely, and essentially save resources and speed since you wouldn't be reDim-ming the array each time thru the loop. The program could process a directory with one file in it, or a directory with 1000 files in it and basically have the same efficiency. If a scenerio came up where you had to restore a month's worth of txt files, then run your program against them, creating a single txt file, there would be no worry about the program running out of resources.

Posting Permissions

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



Click Here to Expand Forum to Full Width