|
-
Feb 5th, 2002, 11:17 AM
#1
Thread Starter
Member
Commas terminating input string
couple things:
I am inputting tab-delimited text and commas are terminating the input strings. Any way to kill this and let commas go thru?
Second, a user wanted all output to be written to a new folder with a date. anyone have code to make a new folder, add name using Now (or something), change path, chdir, open file, write string example, etc.?
-lp
-
Feb 5th, 2002, 11:22 AM
#2
Retired VBF Adm1nistrator
The second question is just simple file I/O, but the first question... I don't understand ...
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Feb 5th, 2002, 11:23 AM
#3
Frenzied Member
VB Code:
Dim filePath 'The full path of the output file
Dim copyToDirectory As String 'Directory to copy files to
copyToDirectory = "C:\Temp\PlayBoy"
Dim fileName As String 'Filename for output
fileName = "PlaymatesOfTheYear.txt"
'Check if the directory exists
'If it doesnt create it.
If Len(Dir(copyToDirectory, vbDirectory)) = 0 Then
MkDir copyToDirectory
End If
'Set the file path to the directory and filename
filePath = copyToDirectory & fileName
'Write stuff to the file
Open filePath For Output As #1
Write #1, "Pamala Anderson"
Write #1, "Jenna Jameison"
Close #1
-
Feb 5th, 2002, 11:41 AM
#4
how are you inputing the TAB delim text? I dont know how a comma would terminate the string!??
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Feb 5th, 2002, 01:27 PM
#5
If you are using Input # to read in the text strings, then a comma will terminate an input string (as will a tab). If you use Line Input # then you'll get a whole line at a time, which you can then parse to find what you are looking for.
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
|