Get it from CNET Download.com!
Skip Navigation Links
Home
Features
Versions
Screenshots
Order Now
Contact
Help
Last update: 07.28.2010 11:00



How to extract a marked part of file
In this example we will extract a part of file marked by __BEGIN__ and __END__ labels and save it into another file.

This is the original file:
The original file


The edit rules we add:

1. Find regular expression "(\A.*^[[:print:]]*__BEGIN__[[:print:]]*\r\n)(.*)(^[[:print:]]*__END__[[:print:]]*\r\n.*\z)":
Edit rule to find the marked text in file

By this regular expression we break a file into three parts: "Preceeding text", "Interesting part" and "The rest".

See also the

Regular Expressions Syntax

.

2. Select the current content of a scratch file (we will use it as a temporary buffer):
Edit rule to select the current content of a scratch file


3. Put the "Interesting part" into scratch file:
Edit rule to replace the scratch file content


4. Now let's prepare the new file name where the file will be saved. First, obtain the current file name:
Edit rule to obtain the file name and path


5. Then compose the new file name using the current path name and extension:
Edit rule to compose the new file name


6. Finally, save the scratch file with the new name that we have created:
Edit rule to save the scratch file


Now the the Edit Rules window contains six rules as shown on the first plot.

Click "Apply all rules" to execute all rules and examine the Data View:
Text got selected and file saved

You can see the "Interesting part" moved to the scratch file and saved.

You can download the example files here: the original file, edit rules and the output file.


Please note that Easy File Editor becomes quite slow when opening a large files. It took several minutes to run this ruleset over a 15 Mb file:
Text got selected in a large file and saved




Download Easy File Editor (3.4 Mb zip,exe)
Current version: 2.3.6, updated on Sun 11/15/2009
Order Now ($ 14.95)


Privacy Statement





DoDownload.com

Home   |   Features   |   Versions   |   Screenshots   |   Order Now   |   Contact us   |   Help