473,408 Members | 1,761 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,408 software developers and data experts.

extracting strings from a text file

Hi, I want to extract strings from the following text file content.

*********************
Description length of global graph compressed
using this substructure = 302.907315

Compression = 0.615889

Instances:

instance first vertex: ID label
------------------------------------------
1 37 b
2 29 a
3 32 a

omitted...

***********************************
I try to extract just this part and put each value into a data table.

1 37 b
2 29 a
3 32 a

1, but there are several empty lines and spaces. how can I deal with several
empty line and spaces?
2, how can I split up the line into each value?
(ex) 1 37 b
----->1 for ID
-----> 37 for instID
-----> b for lable

Welcome any help for me, please.
Thanks a lot.

Eunice.
Nov 17 '05 #1
2 1978
string line = reader.ReadLine();

string fields[] = line.Split('\t'); // if separator is tab char

int ID = fields[0];
int instID= fields[1];
string lable = fields[2];
"Eunice" <Eu****@discussions.microsoft.com> schrieb im Newsbeitrag
news:D6**********************************@microsof t.com...
Hi, I want to extract strings from the following text file content.

*********************
Description length of global graph compressed
using this substructure = 302.907315

Compression = 0.615889

Instances:

instance first vertex: ID label
------------------------------------------
1 37 b
2 29 a
3 32 a

omitted...

***********************************
I try to extract just this part and put each value into a data table.

1 37 b
2 29 a
3 32 a

1, but there are several empty lines and spaces. how can I deal with several empty line and spaces?
2, how can I split up the line into each value?
(ex) 1 37 b
----->1 for ID
-----> 37 for instID
-----> b for lable

Welcome any help for me, please.
Thanks a lot.

Eunice.

Nov 17 '05 #2
Cody, I appreciate your help.
Have a nice day.

Eunice.^^

Nov 17 '05 #3

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

Similar topics

4
by: lecichy | last post by:
Hello Heres the situation: I got a file with lines like: name:second_name:somenumber:otherinfo etc with different values between colons ( just like passwd file) What I want is to extract...
7
by: nephish | last post by:
Hey there, i have a text file with a bunch of values scattered throughout it. i am needing to pull out a value that is in parenthesis right after a certain word, like the first time the word...
0
by: Bubbles | last post by:
Hello. New to ASP.NET and struggling on this one. I have a text file with a bunch of text in it. Throughout the file words followed by a ":" will appear. I need to pull every such string out...
1
by: John Seeliger | last post by:
I am pretty new to VB, so please forgive the simplistic question. This is using VB .NET Standard 2003. My form has three objects on it: a TextBox named URL, a Button named Extract and a...
2
by: Kevin K | last post by:
Hi, I'm having a problem with extracting text from a Word document using StreamReader. As I'm developing a web application, I do NOT want the server to make calls to Word. I want to simply...
16
by: Preben Randhol | last post by:
Hi A short newbie question. I would like to extract some values from a given text file directly into python variables. Can this be done simply by either standard library or other libraries? Some...
4
by: Debbiedo | last post by:
My software program outputs an XML Driving Directions file that I need to input into an Access table (although if need be I can import a dbf or xls) so that I can relate one of the fields...
6
by: Werner | last post by:
Hi, I try to read (and extract) some "self extracting" zipefiles on a Windows system. The standard module zipefile seems not to be able to handle this. False Is there a wrapper or has...
6
by: geegeegeegee | last post by:
Hi All, I have come across a difficult problem to do with extracting UniCode characters from RTF strings. A detailed description of my problem is below, if anyone could help, it would be much...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.