Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-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
Sep 20, 2006
18
0
0
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
-----------------------------------------------------------
 
Replies continue below

Recommended for you

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.
Back
Top