473,394 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Commas in strings

Hi

I am trying to program a simple program in Visual Basic which saves various lines of text into simple text files, then another program loads these text files as strings and outputs them to the screen. My problem is I cannot output a string completely if the text file contains a comma. For example (John Smith, Engineer) will only display as "John Smith" with ", Enginner" being ignored. Can some on give me an idea of how to get round this as all I want is the string to contain exactly what is in the text file.

Frank Leggett
Nov 16 '06 #1
3 1879
willakawill
1,646 1GB
Hi

I am trying to program a simple program in Visual Basic which saves various lines of text into simple text files, then another program loads these text files as strings and outputs them to the screen. My problem is I cannot output a string completely if the text file contains a comma. For example (John Smith, Engineer) will only display as "John Smith" with ", Enginner" being ignored. Can some on give me an idea of how to get round this as all I want is the string to contain exactly what is in the text file.

Frank Leggett
Hi Frank
Best thing would be to post the code you are using. That will get the fastest and best response
Thanks
Nov 16 '06 #2
albertw
267 100+
Hi

I am trying to program a simple program in Visual Basic which saves various lines of text into simple text files, then another program loads these text files as strings and outputs them to the screen. My problem is I cannot output a string completely if the text file contains a comma. For example (John Smith, Engineer) will only display as "John Smith" with ", Enginner" being ignored. Can some on give me an idea of how to get round this as all I want is the string to contain exactly what is in the text file.

Frank Leggett
hi

try reading your file with

Line Input #......instead of Input #....
Nov 16 '06 #3
Thanks alot, Line Input works fine.

Frank
Nov 16 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Randy Yates | last post by:
How to do? Such a simple #@%^&@ thing and I'm spending hours on it. For example, long mynum; istringstream mystr("380,900", istringstream::in); mystr >> mynum; cout << mynum;
22
by: ineedyourluvin1 | last post by:
Hello all! I've been looking for a way to strip characters from strings such as a comma. This would be great for using a comma as a delimiter. I show you what I have right now. ...
7
by: AES | last post by:
Encountered a URL containing a comma the other day -- the first time I've ever noticed that, so far as I can recall. It worked fine, however, and I gather commas are legal in URLs. Out of...
7
by: svm | last post by:
Hi! I'm in the process of creating an invoice-generating program in C#... I've already written the code to produce the page using a PrintDocument, but graphics.DrawString only accepts truetype...
3
by: garyusenet | last post by:
In my continuing education regarding string manipulation, can someone advise me how to take any trailing spaces, and commas from a string. these strings are comming from the streamreader ...
4
by: sherifffruitfly | last post by:
Hi all, I've got a csv file for numeric data, some of which are greater than 10^3. Some bright fellow trying to br helpful put US-standard commas in these numbers, and to maintain the correct...
9
by: conspireagainst | last post by:
I'm having quite a time with this particular problem: I have users that enter tag words as form input, let's say for a photo or a topic of discussion. They are allowed to delimit tags with spaces...
3
by: Junior | last post by:
I want to open a text file for reading and delineate it by comma. I also want any data surrounded by quotation marks that has a comma in it, not to count the commas inside the quotation marks ...
5
by: Robert Dodier | last post by:
Hello, I'd like to split a string by commas, but only at the "top level" so to speak. An element can be a comma-less substring, or a quoted string, or a substring which looks like a function...
4
by: E11esar | last post by:
Hi there. This could be a curious one. Has anybody come across a solution to remove stray commas that appear within strings in a CSV file please? In effect I have many address fields that are...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...

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.