Results 1 to 3 of 3

Thread: Itty Bitty Problem - HUGE pain in the ...

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    17

    Angry

    I have a small project that cuts a huge text file into smaller text files. It does so by searching the file, and at certain points, closing the file and starting a new filename to write to.

    My problem: when i go to declare the filename to write to, I take a string from the file...

    code:

    Line input #1, lineb
    filenamex = (Mid$(lineb, 66, 11)) + ".txt"


    After it gets the string from (Mid$(lineb, 66, 11)), it puts a space before the .txt, so the filename ends up being something like "454k3464354 .txt" My program also writes the filenames to a HTML file, so that space makes things VERY difficult, as you can imagine

  2. #2
    Junior Member
    Join Date
    Mar 2000
    Posts
    29
    Line input #1, lineb
    filenamex = (Mid$(lineb, 66, 11)) + ".txt"

    change to

    Line input #1, lineb
    filenamex = Trim((Mid$(lineb, 66, 11))) + ".txt"

    I don't know why you are having the problem, but this will solve it.

    Line input #1, lineb
    filenamex = (Mid$(lineb, 66, 10)) + ".txt"

    Might solve it also, as you are probably getting the space from the file itself. In this case you are only taking 66 to 76 from the file, which seems to be all you are using.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    17
    Gotcha... Thanks a million

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