read key/value pairs from delimited text file into collection?

G

Guest

I have a text file with the following format (pipe delimited)

|column1=value|column2=value|column3=value|column4=value|...
|column1=value|column2=value|column3=value|column4=value|...


I have two questions.

1. Is this some new type of text file format and if so, what is the name of
it.
2. What functions can I use in .NET to read the key/value pairs into a
collection.

Thanks,

Ron
 
S

Sriram Krishnan

Hmm..I'm not sure whether this is some new type of text file format but
reading it into a collection would be pretty simple. You could either use a
couple of String.Splits or take the regular expressions route .
 
G

Guest

Would it be possible to get a code sample of the regular expression route if
it is not too much trouble? I need to take this file and create afixed field
text file with just the values. The files are rather large so speed is
important. I was looking at the split function where i would have to read
one like at a time, and I am looking for the fastest way possible to do this.

Any help you can provide is appreciated. In the mean time, ill be looking
up the regexp route.

Thanks,

ron
 
G

Guest

Looks like i am gonna go with the split functions and a hash table.

thanks anyway,

Ron
 

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