Results 1 to 5 of 5

Thread: Commas terminating input string

Hybrid View

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    Houston
    Posts
    48

    Question 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

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    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]

  3. #3
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545
    VB Code:
    1. Dim filePath 'The full path of the output file
    2.  
    3.     Dim copyToDirectory As String 'Directory to copy files to
    4.     copyToDirectory = "C:\Temp\PlayBoy"
    5.    
    6.     Dim fileName As String 'Filename for output
    7.     fileName = "PlaymatesOfTheYear.txt"
    8.    
    9.     'Check if the directory exists
    10.     'If it doesnt create it.
    11.     If Len(Dir(copyToDirectory, vbDirectory)) = 0 Then
    12.         MkDir copyToDirectory
    13.     End If
    14.    
    15.     'Set the file path to the directory and filename
    16.     filePath = copyToDirectory & fileName
    17.    
    18.     'Write stuff to the file
    19.     Open filePath For Output As #1
    20.     Write #1, "Pamala Anderson"
    21.     Write #1, "Jenna Jameison"
    22.     Close #1

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    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"

  5. #5
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,526
    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
  •  



Click Here to Expand Forum to Full Width