|
-
May 24th, 2000, 07:17 PM
#1
Thread Starter
Junior Member
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
-
May 24th, 2000, 07:53 PM
#2
Junior Member
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.
-
May 24th, 2000, 08:58 PM
#3
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|