467,169 Members | 992 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,169 developers. It's quick & easy.

Help with parsing text file

I have been reading documentation on parsing. I need some help though.
I have the following in a text file:
$650
Number of Bedrooms 3
Air Conditioning? Yes
Original Ad SOUTH, 3BR, air, basement. $650. Call 278-4171.
First Appeared in the Newspaper
Thursday, October 30, 2003

$775
Number of Bedrooms 3
Number of Bathrooms 2
Type of Parking Garage
Street Address Cashel Ct
Original Ad . New 3BR,2BA, garage. $775. 229-6575
First Appeared in the Newspaper
Friday, October 31, 2003
I want to be able to parse each line of text into a database
(fields:bedrooms,bathrooms,etc), one field for each line.

But, After the text 2003 I need it to know that is the next record.

What would you recommend? I know this is pretty general, but any help is
appreciated!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
  • viewed: 2840
Share:
2 Replies
Looks like two carriage return - line feeds is the record delimiter. So...

Array1 = Split(sourceString, vbcrlf & vbcrlf)
For counter1 = 0 to ubound(Array1)
Array2 = Split(Array1(counter1), vbcrlf)
For counter2 = 0 to ubound(Array2)
'--- process the "record" here...
Next
Next

- Wm
--
William Morris
Product Development, Seritas LLC

"Joey Martin" <jo********@qx.net> wrote in message
news:u3*************@TK2MSFTNGP11.phx.gbl...
I have been reading documentation on parsing. I need some help though.
I have the following in a text file:
$650
Number of Bedrooms 3
Air Conditioning? Yes
Original Ad SOUTH, 3BR, air, basement. $650. Call 278-4171.
First Appeared in the Newspaper
Thursday, October 30, 2003

$775
Number of Bedrooms 3
Number of Bathrooms 2
Type of Parking Garage
Street Address Cashel Ct
Original Ad . New 3BR,2BA, garage. $775. 229-6575
First Appeared in the Newspaper
Friday, October 31, 2003
I want to be able to parse each line of text into a database
(fields:bedrooms,bathrooms,etc), one field for each line.

But, After the text 2003 I need it to know that is the next record.

What would you recommend? I know this is pretty general, but any help is
appreciated!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #2
Joey
Is there a set number of items that can be in the list?
Is there any pattern to the listings?

-dlbjr

Discerning resolutions for the alms
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by wukexin | last post: by
4 posts views Thread by ralphNOSPAM@primemail.com | last post: by
1 post views Thread by sommarlov@gmail.com | last post: by
13 posts views Thread by Chris Carlen | last post: by
6 posts views Thread by Damien87 | last post: by
2 posts views Thread by embz | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.