By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,680 Members | 2,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,680 IT Pros & Developers. It's quick & easy.

How can I keep a comma from delimiting during import...

P: n/a
Thnaks in advance for considering this post. It's probably very simple,
but.....

I have an old VB6 application that allows me to create, save and edit a
"project information file" that is a simple .txt file. I then use that file
to keep the project information current for the multiple AutoCAD drawings
that project requires.

My problem.....several of the items I save are company names (customers).
Many times company names have commas in them. When my VB application imports
a file with a comma in the company name, the comma is interpreted by VB as a
delimiter (spelling) and it splits the name and shifts the balance of the
rest of the information into the next field.

How can I eliminate this from happening??

Thanks again!!
Nov 11 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Unless you can change the old application I don't think you can logically
distinguish company names with comma's from company names without commas. If
it is possible to change the application that creates the files you could
replace commas in company names by a different character and in the other
application replace the differenct character again with a company

One other trick would be to count the comma's in a row if it is fixed and if
the company name is the only field that can contain a comma and the number
of comma's in a row exceeds the expected number of comma's you know that
there is a comma in the company name. You can then in your application
before the split replace the comma by another character and set the
character back.

There might be several solutions for your problem but we don't know the
specifics.

Gabriel Lozano-Morán
Nov 11 '05 #2

P: n/a
My file is not comma delimited. Each piece of data is a new line. So, I
could scan thru each line to find commas and address them as I find them,
correct?

Also, after a little more research, I believe that qoutation marks around
each company name could be a solution, too. Is there a setting for VB to
include quotation marks around data when writing it to a file, or would I
need to hard-code it? I'd have to modify my code in AutoCAD to remove the
quotation marks, though...

Thanks!
Nov 11 '05 #3

P: n/a
> My file is not comma delimited. Each piece of data is a new line.

In that case where does the splitting exactly happen? Cause I was assuming
that you were trying to import a comma-seperated list.

Gabriel
Nov 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.