473,472 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

Ron
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
Nov 22 '05 #1
3 3265
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 .

--
Sriram Krishnan

http://www.dotnetjunkies.com/weblog/sriram
"Ron" <ba*****@online.nospam> wrote in message
news:A0**********************************@microsof t.com...
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

Nov 22 '05 #2
Ron
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

"Sriram Krishnan" wrote:
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 .

--
Sriram Krishnan

http://www.dotnetjunkies.com/weblog/sriram
"Ron" <ba*****@online.nospam> wrote in message
news:A0**********************************@microsof t.com...
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


Nov 22 '05 #3
Ron
Looks like i am gonna go with the split functions and a hash table.

thanks anyway,

Ron

"Ron" wrote:
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

"Sriram Krishnan" wrote:
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 .

--
Sriram Krishnan

http://www.dotnetjunkies.com/weblog/sriram
"Ron" <ba*****@online.nospam> wrote in message
news:A0**********************************@microsof t.com...
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


Nov 22 '05 #4

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

Similar topics

1
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for...
4
by: Bill | last post by:
If, for example, I retrieve a connectionstring from a config file using something like: Value = ConfigurationSettings.AppSettings; This will return a string that is semi-colon delimited. If I...
3
by: Ron | last post by:
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...
3
by: Jeff L. | last post by:
I have an interesting problem and I'm not coming up with any answers in my searches, so hopefully someone can give me a hand with this. I have a feeling it's easy, but I usually get my nose stuck...
5
by: Simon | last post by:
Hi all, I am writing a windows application using vb.net on the 1.1 framework. We have in the application, some strongly typed collections that have been written as classes that do not inherit...
5
by: Denis Petronenko | last post by:
Hello, how can i read into strings from ifstream? file contains values in following format: value11; val ue12; value 13; valu e21;value22; value23; etc. i need to read like file >string,...
9
by: Adi | last post by:
Hello eveyone, I wanna ask a very simple question here (as it was quite disturbing me for a long time.) My problem is to read a file line by line. I've tried following implementations but still...
3
by: Ray | last post by:
Hello World, I made a Windowsform that reads data from a CSV file. It works fine, but when I have read the data of a record I have to re-Debug the form to read another record. So when I put a...
8
by: Andy B | last post by:
I have the object property StockContract.Dictionary which is a dictionary collection of <string, stringkey/value pairs. I need to be able to retreive the keys and their values and display them on a...
2
by: toodlez | last post by:
Hi, I'm pretty new to C++ and I want to find the min and max value in a collection of values. The pairs are in a text file and contain a descriptor and a value. For example: Bob 120 Jack 7 Larry -90...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.