PDA

View Full Version : How do i extract a part of text file content



aish718
12-25-2017, 10:27 PM
Hi,
I am just learning VB. I need to know how can i extract specified record from text file1 having many records as data and save the extracted data in another text file2.Text file1 data is something like

type Z is

record
***

end record

type Y is

record
***

end record

and some n of records are in this text file1

I want to have only specified records like extract only Z , Y records of X , Y , Z records from text file1

I think i am clear with question. Can someone help with this??

Thanks in advance.

p45cal
12-26-2017, 05:21 AM
A sample text file would help a lot.
If you can indicate the output you want from that text file, that would be good too.

aish718
12-26-2017, 05:35 AM
Input text file1 has data as :

type Z is
record
***
end record

type Y is
record
***
end record
type X is
record
***
end record
type W is
record
***
end record


Output text file2 should have only selected record data as :

type X is
record
***
end record

I think this will help and each record names are unique . TIA:)

aish718
12-26-2017, 05:37 AM
Can i give line numbers or anything to find start line number and end line number of record? so that i can extract the data within that range ?

mancubus
12-26-2017, 05:52 AM
A sample text file would help a lot.
If you can indicate the output you want from that text file, that would be good too.