473,808 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

displaying delimited text

Ron
How do I display delimited text on multiple lines in a listbox?

For example in my textbox I have this:
Joe Doe,123 Street,Mytown

and In a listbox then I want to display:
Joe Doe
123 Street
Mytown

How would I step through that string and seperate the words by the
comma?

Feb 26 '07 #1
4 1230
On Feb 26, 9:43 am, "Ron" <pts4...@yahoo. comwrote:
How do I display delimited text on multiple lines in a listbox?

For example in my textbox I have this:
Joe Doe,123 Street,Mytown

and In a listbox then I want to display:
Joe Doe
123 Street
Mytown

How would I step through that string and seperate the words by the
comma?
Cation - air code follows:
listbox1.items. addrange(delimi ted.Split(",".T oCharArray()))

--
Tom Shelton

Feb 26 '07 #2
"Tom Shelton" <to*********@co mcast.netschrie b:
>How do I display delimited text on multiple lines in a listbox?

For example in my textbox I have this:
Joe Doe,123 Street,Mytown

and In a listbox then I want to display:
Joe Doe
123 Street
Mytown

How would I step through that string and seperate the words by the
comma?

Cation - air code follows:
listbox1.items. addrange(delimi ted.Split(",".T oCharArray()))
.... ='delimited.Spl it(","c)'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Feb 26 '07 #3
Ron
so if my textbox is named textbox1 and my listbox is named
ltsdisplay, for the button that would make this all happen I would
just need to:

lstdisplay.item s.textbox1(deli mited.Split("," .ToCharArray()) )

is that right? or no? I try this and I get an error...
On Feb 26, 5:20 pm, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...@gmx.atwrot e:
"Tom Shelton" <tom_shel...@co mcast.netschrie b:
How do I display delimited text on multiple lines in a listbox?
For example in my textbox I have this:
Joe Doe,123 Street,Mytown
and In a listbox then I want to display:
Joe Doe
123 Street
Mytown
How would I step through that string and seperate the words by the
comma?
Cation - air code follows:
listbox1.items. addrange(delimi ted.Split(",".T oCharArray()))

... ='delimited.Spl it(","c)'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Feb 27 '07 #4
Ron wrote:
so if my textbox is named textbox1 and my listbox is named
ltsdisplay, for the button that would make this all happen I would
just need to:

lstdisplay.item s.textbox1(deli mited.Split("," .ToCharArray()) )

is that right?
Not quite.

"delimited" in the samples you've been given is the delimited string, which
in your case is "Textbox1.T ext" (that's where the system gets the delimited
string from).

And also the code is more concise using Herfried's suggestion of how to
provide a character variable containing a comma.

Try this:

\\\
lstDisplay.Item s.AddRange(Text box1.Text.Split (","c))
///

--

(O)enone
Feb 27 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7036
by: Ben | last post by:
Hi all - I am having a bit of trouble and thought maybe someone in this group could shed some light. Here's the skinny... I am creating an automated process to import a bunch of text files into Access. I want to avoid creating a separate "Spec" for each file (there are over 180 files) and instead want to code my own dynamic importing rules. So far it's been going fine, except for one item...
5
1421
by: Amjad Farran | last post by:
What is the easiest way to display in a table, a delimited text data saved in a text file? I need an idea so that I can research it! Amjad
3
2440
by: Joe Fisherman | last post by:
I have used regex to parse a huge text file, and grab a tab delimited portion of it. I often use comma delimited text files, and use Jet Oledb4. I read that I would need an ini if the file wasn't comma delimited - if this is true, I am not sure of the easiest process to create an ini. The string has a header. My string looks like: "Call" "Date" "Time" "Call Period" "From" "Call Type" "Number Called" "To" "Call Length" "Local Airtime...
1
2596
by: j7.henry | last post by:
I am trying to pull specific data that is in a comma delimited file into a web page. So if my comma delimited file looks like: Name,Address,Zip Fred,123 Elm,66666 Mike,23 Jump,11111 I would like to be able to read this data and put each row into a variable? so I could display the values in a web page where I want.
2
4776
by: denisel | last post by:
Hi, We will be conducting surveys through SurveyMonkey online and will be importing the answers by tab delimited or comma delimited file into access. I was wondering if there is specific way to import delimited files into Access or Is there a specific way I should design the survey online so Access can recognize the file? Here is my table structure to give you an idea on where I'm coming from. Thank you so much in advance!!! ...
1
8190
by: Fordraiders | last post by:
vb.net 2003 Office 2003 What I have: C:\TestData\Input.txt Text File Pipe Delimited : 4 columns Of data example: 00001|NO BRAND NAME ASSIGNED|6DU27|M3-.5 X 6 FLAT HD SOCKET CAP SCREW, CL10.9, ALLOY STEEL 00002|NO BRAND NAME ASSIGNED|6DU28|M3-.5 X 8 FLAT HD SOCKET CAP SCREW,
2
2140
by: Ron | last post by:
so if my textbox is named textbox1 and my listbox is named ltsdisplay, for the button that would make this all happen I would just need to: lstdisplay.items.textbox1(delimited.Split(",".ToCharArray())) is that right? or no? I try this and I get an error...
6
22568
by: =?Utf-8?B?UmljaA==?= | last post by:
'--this code works but only reads text into one column when contains multiple cols Dim ds1x As New DataSet Dim ConStr As String = _ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\dir1A\;Extended Properties=""Text;HDR=No;FMT=Delimited\""" Dim conn1x As New OleDb.OleDbConnection(ConStr) Dim dax1 As New OleDbDataAdapter("Select * from testabc1x.txt", conn1x)
7
2057
by: archana | last post by:
Hi all, I have csv file which i want to show into datatable. when i try to use oledb to copy content of csv file into datatable not all rows are getting copied into datatable. Some last rows are missing. What i observe it if i open csv file in textpad and save that in file format 'PC' it starts working. I am not getting why this is happending?
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9600
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
10631
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9196
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
7651
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
5548
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
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
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

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.