strextract(1int)
NAME
strextract − batch string extraction
SYNTAX
strextract [ −p patternfile ] [ −i ignorefile ] [ −d ] [ file... ]
DESCRIPTION
The function strextract is used to extract all text strings from the program file. The process is driven by a pattern file which contains details of patterns that are to be matched, or ignored, in the source file. The text strings which are extracted are written to a message file. If the input is taken from the standard input the text strings are written to the standard output, otherwise they are written to a message file with the suffix .msg.
The format of the message file is as follows:
line_number byte_offset length text_string
After running strextract, the message file can be edited to remove text strings which do not need translating before running strmerge to rewrite the source file and insert the text given by the REWRITE directive in the pattern file.
By default, if any duplicate strings are found, they are reported to the standard error output and written to the message file. This can be overridden by the −d option.
If strings are found which match the ERROR directive in the pattern file, they are reported on the standard error but are not written to the message file.
It is recommended that extract is used as a visual front end to strextract rather than running strextract directly.
OPTIONS
−iSpecifies a new ignore file to be used to instruct strextract to ignore specific text strings. The default is to search for ignore in the current directory, the home directory, and /usr/lib/intln.
−pSpecifies a new pattern file to be used. This file tells strextract which patterns are to be matched or ignored within the source file. The syntax is described in patterns. The default value for patternfile is pattern.
−dIf this flag is set warnings are not printed for duplicate strings.
EXAMPLES
The following produces a message file, prog.cat, for a program called prog.c.
strextract −p c_patterns prog.c
vi prog.msg
strmerge −p c_patterns prog.c
gencat prog.cat prog.msf
RESTRICTIONS
With the current syntax of the pattern file, it is not possible to ignore strings in multi-line comments.
Only one rewrite string can be specified for all classes of pattern matches.
The program does not recurse through include files. These have to be worked on separately.
Multi-line strings are not recognized.
SEE ALSO
ed(1), gencat(1int), extract(1int), strmerge(1int), patterns(5int)