Breaking a data file up
Breaking a data file up
(OP)
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
-----------------------------------------------------------
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
-----------------------------------------------------------





RE: Breaking a data file up
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