Results 1 to 6 of 6

Thread: [RESOLVED] Removing " marks from saved files

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Posts
    248

    Resolved [RESOLVED] Removing " marks from saved files

    Hi all,

    I currently save files from within VB like so:

    Code:
    Dim ABC as String
    Dim FF as integer
    
    FF = FreeFile()
    
    ABC = "XYZ Any string here"
    
    Open "C:\SavedFile.txt" for Output as #FF
    Write #FF, ABC
    Close #FF
    This is fine, but it saves the strings with "" marks at tne beginning and end of the string. For example, in our sample file for this code, the text in the file would be:

    "XYZ Any string here"

    This is fine usually but I need to load the values without " marks. I know I can remove them during input, but I seem to remember that you can avoid that by using a different work wather than write to output the file. I tried print but it left massive gaps between the values (in the text file).

    Any headsup on the word/method that I need to write the file without it having " marks? I've got a feeling I figured this out before, and it was just a simple word, but I can't find the code.

    Thanks,
    Arby.

  2. #2

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Posts
    248

    Re: Removing " marks from saved files

    Ahh, I did try print, but for some odd reason it puts a load of spaces in after the value, for example:

    Code:
    "ABC", "ABCD", "ABCDE"
    becomes

    Code:
    ABC                   ABCD                   ABCDE
    Any ideas?

  4. #4
    Addicted Member
    Join Date
    Apr 2006
    Posts
    155

    Re: Removing " marks from saved files

    VB Code:
    1. Print #num, "hello"; Space(1); "bye"

  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Removing " marks from saved files

    When you separate the arguments with a comma the data is printed in the "next print zone".

    Use the semi-colon instead

    Print #1, "ABC"; "ABCD"; "ABCDE"

    Note that with Print you need to actually print the comma to create a CSV file.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Posts
    248

    Re: Removing " marks from saved files

    Ahh cool, thanks for the help people!

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