tab delimited string (regex'ed) into a table

J

Joe Fisherman

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 Rate" "Local
Airtime Charges" "Tax" "LD Charges" "LD Tax" "Additional Call
Charges" "Total"
1 11-Nov 07:23 D OTTAWA ON OG 6158365872 TORONTO ON 3:00 $0.10
$0.30 B $0.00 $0.00 $0.30
2 11-Nov 11:36 D INCOMING IN 6157172119 OAK ON 4:00
$0.10 $0.40 B $0.00 $0.00 $0.40

......


Any ideas on the best way to pull this data into a table or dataset?

Thanks,

Joe
 
H

Herfried K. Wagner [MVP]

* Joe Fisherman said:
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.

Have a look at <http://www.connectionstrings.com> -> "Text"...
 
J

Joe Fisherman

(e-mail address removed) (Herfried K. Wagner [MVP]) wrote in

Thanks for the tip. The text is in memory in a string - do you think
it is best to save the text to a text file, then import using Jet like
this?


I ended up giving up on this route. Saving to a temporary text file, then
reading with JET into a dataset worked fine, but seemed like an awkward way
to do it when the source was already in a string. I used the string split
on the line feed, then a string split on the tab character, then parsed
away.. It looks like it is working fine. Not sure if I did the 'most
efficient' thing.

Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top