parsing a delimited text file to an ArrayList
parsing a delimited text file to an ArrayList
parsing a delimited text file to an ArrayList
parsing a delimited text file to an ArrayList
parsing a delimited text file to an ArrayList
parsing a delimited text file to an ArrayList parsing a delimited text file to an ArrayList parsing a delimited text file to an ArrayList parsing a delimited text file to an ArrayList parsing a delimited text file to an ArrayList parsing a delimited text file to an ArrayList parsing a delimited text file to an ArrayList parsing a delimited text file to an ArrayList
parsing a delimited text file to an ArrayList parsing a delimited text file to an ArrayList
parsing a delimited text file to an ArrayList
Go Back  Xtreme Visual Basic Talk > > > parsing a delimited text file to an ArrayList


Reply
 
Thread Tools Display Modes
  #1  
Old 02-07-2004, 06:21 PM
rbutturini rbutturini is offline
Newcomer
 
Join Date: Feb 2004
Posts: 7
Default parsing a delimited text file to an ArrayList


Hello All!

I am hoping to get some help here. I think this is an easy problem to solve, but I'm having trouble reasoning through it.

I have a text file which is a dump from a database query.. The text in it looks like this:

Badge # Name Status
"001234","Doe,Jane","A"

What I need to do is read the badge #, concatenate a dash, concatenate the name, and put that into a slot in array list lstUsers. If somebody coudl give me some guidance I would GREATLY appreciate it!!

Russell
Reply With Quote
  #2  
Old 02-08-2004, 04:21 AM
herilane's Avatar
herilaneparsing a delimited text file to an ArrayList herilane is offline
Unashamed geek

Retired Moderator
* Expert *
 
Join Date: Jul 2003
Location: London, England
Posts: 8,988
Default

The general approach would be like this:
Code:
Open strPath For Input As #1 Do While Not EOF(1) ReDim Preserve strArray(i) Input #1, strBadge, strName, strStatus strArray(i) = strBadge & "-" & strName i = i + 1 Loop Close #1
Reply With Quote
  #3  
Old 02-08-2004, 11:26 AM
rbutturini rbutturini is offline
Newcomer
 
Join Date: Feb 2004
Posts: 7
Default

Thanks for the general tips. The problem I"m having is I'm using streamreader to open the file whole lines at a time (this was the only file I/O class we learned about in VB while I was in college :-( ). Is there something better I can use for this?
Reply With Quote
  #4  
Old 02-08-2004, 11:57 AM
herilane's Avatar
herilaneparsing a delimited text file to an ArrayList herilane is offline
Unashamed geek

Retired Moderator
* Expert *
 
Join Date: Jul 2003
Location: London, England
Posts: 8,988
Default

Since you posted this in the Legacy VB section, I gave you a Legacy VB solution
Hang on, I'll get this moved to .Net which is where this seems to belong.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
File I/O GavinO Tutors' Corner 5 04-17-2013 02:18 PM
Installation Problem - PLs help urgenlty dpdsouza Installation / Documentation 4 12-02-2004 08:09 PM
Parsing comma delimited text file tosnti General 1 03-19-2003 05:42 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
parsing a delimited text file to an ArrayList
parsing a delimited text file to an ArrayList
parsing a delimited text file to an ArrayList parsing a delimited text file to an ArrayList
parsing a delimited text file to an ArrayList
parsing a delimited text file to an ArrayList
parsing a delimited text file to an ArrayList parsing a delimited text file to an ArrayList parsing a delimited text file to an ArrayList parsing a delimited text file to an ArrayList parsing a delimited text file to an ArrayList parsing a delimited text file to an ArrayList parsing a delimited text file to an ArrayList
parsing a delimited text file to an ArrayList
parsing a delimited text file to an ArrayList
 
parsing a delimited text file to an ArrayList
parsing a delimited text file to an ArrayList
 
-->