473,721 Members | 2,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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.....sev eral 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
3 1875
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
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
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
4565
by: Alberto Vera | last post by:
Hello: I have the next structure: How Can I make it using Python? How Can I update the value of 6?
2
5127
by: jamesthiele.usenet | last post by:
I recently ran into the issue with 'print' were, as it says on the web page called "Python Gotchas" (http://www.ferg.org/projects/python_gotchas.html): The Python Language Reference Manual says, about the print statement, A "\n" character is written at the end, unless the print statement ends with a comma. What it doesn't say is that if the print statement does end with a
3
5432
by: Elmo Watson | last post by:
I've been asked to develop a semi-automated type situation where we have a database table (sql server) and periodically, there will be a comma delimited file from which we need to import the data, replacing the old. I naurally know that we can use to kill the other data, but does anyone have any examples of importing a comma delimited file into SQL Server with ASP?
1
9754
by: DCM Fan | last post by:
Access 2K, SP3 on Windows 2K, SP4 All, I have an import spec set up with quoted Identifiers and comma-separated values. The text file is produced by a 3rd-party program of which I have no control. It outputs all text fields surrounded by quotes, and all numeric fields w/o quotes. All fields are separated with commas. This has been working for 2 years, until today, when one of the data fields
1
2131
by: don | last post by:
I'm trying to import a comma delimited text file into MS Access 2002 version - the first column is set for an auto increment primary key and everything works right the first time I import a text file, however when I try to append to this new database table Access always messes up the import - as long as I ieave the auto increment column out it has no trouble appending to the database , and then I have to add the auto increment column...
4
285
by: SteelDetailer | last post by:
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...
15
2628
by: Lighter | last post by:
In 5.3.3.4 of the standard, the standard provides that "The lvalue-to- rvalue(4.1), array-to-pointer(4.2),and function-to-pointer(4.3) standard conversions are not applied to the operand of sizeof." I think this rule is easy to understand. Because I can find the contexts of applying the rule as follows. (1) int* p = 0; int b1 = sizeof(*p); // OK, b1 = 4, *p would not be evaluated.
2
18427
by: KiP.Kolodziejczyk | last post by:
I 'd like to insert (via "bulk insert") between 10-20 files (about 300MB each) into one table. The problem is that in input files decimal point is written as "," and without leading zeros (i.e.: ",45"), and sever uses ".". So I 've got an "type mismatch" error. I can't re-build input file, as well as I can't change configuration of mssql sever. Is there any option to force the server to convert decimal point while importing?
2
1739
by: bizt | last post by:
Hi, I am performing an XSLT on a XML feed. The XSLT produces me with PHP code that I eval then insert into my DB. However, the way that the system Im assigned to is setup, I need to convert all instances of comma ',' to entity ',' .. so this requires that the output of the XSLT needs to produce ',' but instead it converts it to a comma which the current system doesnt like when handling it. Below shows a snippet of what I have. What is...
0
8730
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9064
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8007
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6669
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4484
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3189
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2130
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.