home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
112.lha
/
Files
/
fixslice.doc
< prev
next >
Wrap
Text File
|
1986-11-20
|
2KB
|
57 lines
These are 2 simple text utilities I find quite handy.
filefix is a search and replace utility. It will replace any occurance of a
string of up to 40 characters with another string. The strings can consist of
characters or hex values. Wildcards are not supported, it does a literal search
and replace.
filefix is not line oriented so it can be used on executable program code as
well as text files.
filefix can be used in both a prompt and no prompt mode.
Examples:
'filefix ?'
: print instructions and start in prompt mode
'filefix'
: start in prompt mode
'filefix test test1 yes no'
: replace every occurance of 'yes' in file test
with 'no' in new file test1. test1 is created.
'filefix test test1 yes no y'
: same as above except you are prompted to answer
'y' or 'n' for each replacement.
'filefix test test1 [0a] [0a][0d]'
: convert all line feeds to line feed/return
Each run will give you the number of replacements, number of lines and
characters in the file.
------------------------------------------------------------------------------
slice is useful for taking horizontal slices from a text file. By specifing a
match word and a number of lines you can get the next x lines after a keyword
match. This is similar to GREP except you can get several lines to determine
the context of the match. Again, no wildcard support.
You can get up to 4 different slices of a text file at one time.
Examples:
'slice'
:print instructions
'slice test test1 if 2'
:find every occurance of 'if' and print that line and the next 2 lines to a
new file named test1
'slice test test1 if 2 then 3'
:print 'if' and the next 2 lines and 'then' and the next 3 lines.
Comments are welcome.
Donald L. Wahl
CIS 76515,1510
BIX dwahl
PLINK ops492