CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Ignore Commas

  1. #1

    Ignore Commas

    Using Visual Basic 6, I'm trying to import a non comma separated text file to a database and I'm inputting("Input #1") the lines line by line and then I test it with a series of If statements using "mid(integer, 1, 10)" (this is an example). Now this is all fine but if one of those (1+10)characters is a comma (like "Long, Mike") then it goes to the next field and throws the hole thing off.
    Can someone help me?


    /\
    / \
    ____/ \ __/\ ___________________
    \ / \/
    \ /
    \/

  2. #2

    Re: Ignore Commas

    I feel that the first message was not direct and was a little around the bush.

    If I have an integer with the text "Long, Mike" and I want to putt that in to a database field "Database.Field1 = integer" it will put "Long" into field1 and "Mike" into field2 but I want "Long, Mike" in field1 and nothing in field2. How can I do that?

    Signed:
    Magnetic Flux
    A.K.A. MFlux
    "There is no spoon!"

  3. #3
    Guest

    Re: Ignore Commas

    Use get an put to format the input file first. This will put a necessary delimiter for you. If U know the file structure then it is simple. If U dont know the structure try parsing each idenifier and use a counter how many fields will be in each line.

    Hope this will be of some use.


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

Featured