473,386 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Reading complex Data from a file

Hello
I have a data file like this :
01 "" "09:04" "PLMDX " 3.20 0.35 1.74 0.23 2.49 0.17
1.37 0.18 03
02 "" "09:05" "PLMDX " 3.70 0.18 1.93 0.14 2.75 0.19
1.05 0.01 03
03...
04...
......
and i want to read each number and fileds and save it to variables to save
it in to the database .
with stream reader and file rader i can only read all of it as a single
string , is that possible to do it with regular expression ? i don't know
how . any idea ...
help please


Nov 15 '05 #1
1 2214

"Blue man" <fa**********@yahoo.co.uk> wrote in message
news:e5**************@TK2MSFTNGP10.phx.gbl...
Hello
I have a data file like this :
01 "" "09:04" "PLMDX " 3.20 0.35 1.74 0.23 2.49 0.17 1.37 0.18 03
02 "" "09:05" "PLMDX " 3.70 0.18 1.93 0.14 2.75 0.19 1.05 0.01 03
03...
04...
.....
and i want to read each number and fileds and save it to variables to save it in to the database .
with stream reader and file rader i can only read all of it as a single string , is that possible to do it with regular expression ? i don't know how . any idea ...
help please


Can't you use the ReadLine() method of StreamReader? It looks like
everything is on a row-by-row, line-by-line basis.

Once you have a line, then you can use a Regex to split it.
Unfortunately String.Split() won't work because of the quotes.

-c

Nov 15 '05 #2

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

Similar topics

2
by: Satish Chimakurthi | last post by:
Hi all, This is in continuation of my email today regarding reading data files. I am stuck with one more problem now. Here are my two data files: a. fluid_grid.dat 1.00000000000000 ...
4
by: Mark Stijnman | last post by:
A while ago I posted a question about how to get operator behave differently for reading and writing. I basically wanted to make a vector that can be queried about whether it is modified recently...
0
by: davis | last post by:
ok I am new to xml and probably will use .net. my problem is I would like to read the xml file into a dataset, making it easy to navigate the data. however, my 1st xml file is simply too complex...
116
by: Mike MacSween | last post by:
S**t for brains strikes again! Why did I do that? When I met the clients and at some point they vaguely asked whether eventually would it be possible to have some people who could read the data...
8
by: Steve Jorgensen | last post by:
Mailing List management is a good example of a case where my conundrum arises. Say there is a m-m relationship between parties and groups - anyone can be a member of any combintation of groups. ...
0
by: scorpion74 | last post by:
Hi All I am developing a very complex application that hosts UserControl in IE Browser.Usercontrol has treeview and datagrid control basically.The data is in xml file and which is hierarchical...
8
by: Martin Eyles | last post by:
Hi, I have a configuration file I made in xml which I am using to name a database server. (this way I can deploy my web page on various servers, and just change this file to make it work)....
4
by: Ganesh Muthuvelu | last post by:
Hi STAN, Stan: Thanks for your response to my previous post on reading a XSD file using your article in "https://blogs.msdn.com/stan_kitsis/archive/2005/08/06/448572.aspx". it works quite well...
3
by: John | last post by:
How can I tell if a line begins with a number instead of a character? I need to read a text file and some of the data begins with a character which is causing me an issue in reading and uploading...
9
by: dba123 | last post by:
I need some help and direction on what classes and an example or two (article) on how to read an Excel Worksheet and insert one column into a database table column. I am using .NET 2.0 only. What...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.