Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Breaking a data file up

Status
Not open for further replies.

ohagan

Electrical
Joined
Sep 20, 2006
Messages
18
Location
CA
Hi,

I am trying to read a file and extract only a section of it, for example if the read file was the text below I would only want to extract the text between "test1" and end_test", which would be "this is a test to see if i can get these words from this file." My goal is to take only the useful portion and write it to another file for use later on in my program. Any ideas on how to actually get only the section of the file that I want?

Thanks.

-----------------------------------------------------------
brewvouibreouvibuorebvourebvoubreouvberoubvorebvorebvorebvouibreobvreoabvoubrewbuovbroeubvoarewbv';barwe'ovb test1 this is a test to see if i can get these words from this file end_test poinfwoiprnvioprwevioerovbierovoewrnvpiwnrviopnreovinerov
-----------------------------------------------------------
 
ohagan,

Try textscan

You can have it read one %s, string, at a time which i think it considers a space or carriage return delimited series of alpha numeric characters. Then an if statement for the exact string you want. Like 'test1 '.

Hope this helps

BSK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top