LEXTRACT.EXE

Version 1.0a of June 2002
COPYRIGHT (C) 1997-2002 Norbert H. Doerry


1. Description

LEXTRACT.EXE is a utility for extracting records from an ASCII flat file based on a search string. Only those records in the input file which have a match with the search string are printed in the output file. If a starting column is specified, a match means that the search string is identical to the string starting in the specified column (number of characters from the start) of each record.
If a starting column is not specified, then a match means the search string can be found anywhere in the record. The comparisons are by default case sensitive, but can be specified to be case insensitive.

Records may either have a fixed length, or may be newline delimited. If a fixed length is not specified, then the records are assumed to be newline delimited.


2. Syntax

LEXTRACT.EXE  infile -sXXX -cXX -i -rXX -oOutfile -?

   where

   infile   = Name of input ascii flat file
              if omitted, data is taken from stdin
   -sXXX    = XXX is the search string
   -cXX     = XX is the column to look for the search string,
              if omitted, searches the entire record (line)
   -i       = ignore case of search string
   -rXX     = record length, including terminating newline if present
              if omitted, assumes lines are terminated with newlines
   Outfile  = Name of ascii output file
              if omitted, output is written to stdout 
   -?         Prints Syntax, then exits.

3. Comments


4. Examples

       lextract test1.txt -saaa -c4 -otest1out.txt

       lextract test1.txt -saaa -c4 -i -otestiout.txt
       

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.