% VAX-11 Librarian V04-00h7,'ϒ5EXTRACT,'ϒ 1 EXTRACTD General purpose file extraction utility. Selects records from theH beginning, middle, or end of one or more files and optionally performs0 various modifications before writing them out. format: EXTRACT 'options' file,...6 EXTRACT /RECORD=([START=m,END=n,COUNT=k]) file,... EXTRACT /HEAD=k file,... EXTRACT /TAIL=k file,... 2 Parameter7 file[,...] input file(s); wildcards are supported.dE All output is written to a single file (default is SYS$OUTPUT) evene( if multiple input files are specified. 2 Qualifiers/BLOCKSK /BLOCKS[=(option,...)])H Similar to DUMP/BLOCKS; extracts blocks from the input file(s) without& interpreting their record structure.G Up to two of the following options may be specified; if more than onenJ is used, separate them with a comma and enclose the list in parentheses.D START=m starting block number; the first block in the file is 1.B A negative value specifies a numbe r of blocks relativeD to the end of the file: -1 is the last block, -2 is the! one before that, etc.n> END=n ending block number; the last block of the file is- considered to be block number -1. D COUNT=k number of blocks to extract. If START is specified, ENDD is derived by adding COUNT-1 to it; if END is specified,F START is derived by subracting COUNT-1 from it; if neither= is specified, START is 1 and END is se t to COUNT./B Incompatable with /RECORDS, /HEAD, and /TAIL. Also incompatable; with /COLUMNS, /EXPAND_TABS, /TRANSLATE, and /VFC_HEADER.)/COLUMNS /COLUMNS=([-,]column_range,...)B Select or reject certain columns within extracted records beforeE writing them to the output file. 'column_range' is either a singlerC column number or a low and high pair separated by "-" or ":". IftG more than one range is desired, separate them with commas and encloseeD the list in parentheses. If the first element of the list is "-",D then the rest of the list represents columns to reject rather than ones to select. A If the first range begins with ":" (ie, ":20") then column 1 is(C implied; if the last range ends with ":" (ie, "41:") or ":*" theno# the end of the record is implied.eD Note: the output record consists of the selected columns in theirC original relative positions, not in the order listed in /COLUMNS.hE That is, /COLUMNS=(25:30,5:10) produces the same out put as the list. (5:10,25:30). /EDITr /EDIT=(option,...)tC Perform one or more of various modifications to extracted recordsTB before writing them to the output file. The available functions? include all options of the DCL F$EDIT() lexical function plusM several extensions: > COLLAPSE, COMPRESS, LOWERCASE, TRIM, UNCOMMENT, UPCASE,7 STRIP_TRAILING, IGNORE_QUOTES, FALLBACK, FORMAT.eE If more than one option is specified, separate them with commas and & enclose th e list within parentheses.* See "edit_options" for more information. /EXPAND_TABS /[NO]EXPAND_TABSsE Convert ASCII tab characters into spaces. Tab stops are considered 7 to be positioned at every 8th column: 9, 17, 25, ...tG By default, tabs are expanded if extraction by columns (/COLUMNS=xxx)CG or translation into EBCDIC (/TRANSLATE=ASCII_TO_EBCDIC) is requested,a and left as tabs otherwise.nH Tab expansion is never performed if translation from EBCDIC into ASCII, (/TR ANSLATE=EBCDIC_TO_ASCII) is requested./HEADe /HEAD[=count]D Extract records from the beginning of the file(s). 'count' is theH number of records to extract; if not present, the default value is 22.F A negative 'count' value designates the number records at the end ofG the file to omit. That is, /HEAD=-5 will extract every record in thet file except for the last 5.d1 Incompatable with /BLOCKS, /RECORDS, and /TAIL.s /IDENTIFYi /[NO]IDENTIFYE Determines whether to disp lay the input file name before performing,D extraction upon its contents. By default, the file identificationB is performed if the input file specification is a list of files,F contains any wildcards, or includes a search list. /IDENTIFY forces6 identification; /NOIDENTIFY suppresses identication.F Note: the file identification is written to the same destination asE the extracted data, so it should normally be suppressed if the data= is being translated into EBCDIC or if vfc-headers are kept.f/OUTPUT= /OUTPUT[=file]fI Specifies the output file. Output is written to SYS$OUTPUT by default.rE File format is variable length records with implied carriage returnaE (ie, standard text file format), unless whole records are extractedtI from a file having fixed length records. /VFC_HEADER=KEEP will produceEG a VFC format output file (but only if the input file has VFC format).t/RECORDS /RECORDS[=(option,...)]G Similar to DUMP/RECORDS but with more flexibilitG Up to two of the following options may be specified; if more than oneJ is used, separate them with a comma and enclose the list in parentheses.F START=m starting record number; the first record in the file is 1.C A negative value specifies a number of records relativeE to the end of the file: -1 is the last record, -2 is the! one before that, etc.@ END=n ending record number; the last record of the file is. considered to be recor y in indicating whicho> records. Extracts specified records from the input file(s).G Up to two of the following options may be specified; if more than one J is used, separate them with a comma and enclose the list in parentheses.F START=m starting record number; the first record in the file is 1.C A negative value specifies a number of records relativeeE to the end of the file: -1 is the last record, -2 is thef! one before that, etc.d@ END=n ending record number; the last record of the file is. considered to be record number -1.E COUNT=k number of records to extract. If START is specified, ENDsD is derived by adding COUNT-1 to it; if END is specified,F START is derived by subracting COUNT-1 from it; if neither= is specified, START is 1 and END is set to COUNT.e. Incompatable with /BLOCKS, /HEAD, and /TAIL./TAIL /TAIL[=count]E Extract records from the end of the file(s). 'count' is the number'A of records to extract; if not present, the default value is 22.oE A negative 'count' value designates the number records at the startfF of the file to omit. That is, /TAIL=-5 will extract the entire file! except for the first 5 records.O1 Incompatable with /BLOCKS, /RECORDS, and /HEAD.c /TRANSLATE1 /TRANSLATE={ ASCII_TO_EBCDIC | EBCDIC_TO_ASCII }tF Translate data (which is assumed to represent simple character text)E from ASCII into EBCDIC or vice ver sa. One of the two keywords mustDF be specified. If ASCII_TO_EBCDIC is used then tab expansion is doneE unless /NOEXPAND_TABS is specified. If the reverse is used, no tabn9 expansion will be attempted regardless of /expand_tabs.eE Translation from EBCDIC into ASCII is done before any modificationssF from /EDIT are performed; translation from ASCII into EBCDIC is done* after any requested edits are performed. /VFC_HEADERh% /VFC_HEADER={ IGNORE | DATA | KEEP } C Specifies how to  handle files in variable-with-fixed-control-areaHE format (such as batch .log files). By default, the control area is G ignored. /VFC_HEADER=DATA causes the control area, which is normallysG hidden, to be treated as part of the normal record contents. A valuesE of KEEP causes the output file to have the same format as the inputiE file (rather, as the *first* input file if there is more than one)./F If the [first] input file is not in VFC format, /VFC_HEADER=KEEP has no effect."!/ TRUNCATE -- not implemented"!/WIDTH -- not implemented"!/WRAP -- not implemented2 edit_options Options available for /EDIT:- COLLAPSE -- remove all spaces and tabs G COMPRESS -- convert multiple spaces and tabs into a single spacee; LOWERCASE -- convert unquoted letters into lower-case G TRIM -- remove leading and trailing blanks (spaces and tabs)u< UNCOMMENT -- remove comments (from "!" to end of line); UPCASE -- convert unq uoted letters into upper-cased? STRIP_TRAILING -- remove trailing blanks (spaces and tabs)rB IGNORE_QUOTES -- don't check quotes ("xxx") when doing edits9 FALLBACK -- strip 8-bit data into 7-bit equivalentaD FORMAT -- convert non-visible (control) characters into "."F If both UPCASE and LOWERCASE are specified, UPCASE takes precedence.H COLLAPSE supercedes COMPRESS and TRIM; TRIM supercedes STRIP_TRAILING.H Quoted text is subject to FALLBACK and FORMAT modifications regardless/ of whether or not IGNORE_QUOTES is specified.1 2 examples9 !Display the last 10 lines of Login.Com on the terminal ' $ EXTRACT/TAIL=10 Login.Com /IDENTIFY: !Look at the first few lines of all Fortran source files $ EXTRACT/HEAD=5 *.For= !Copy Test.Txt to Test.Dat, converting text into upper case. ! and removing excess blanks.; $ EXTRACT/EDIT=(UPCASE,COMPRESS) Test.Txt/OUTPUT=Test.DatR? !Extract all but the first 10 and last 10 records of Test.Datn@ $ EXTRACT Test.Dat/RECORDS=(START=11,END=-11) /OUTPUT=Test.Mid, !Get specific columns out of several files: $ EXTRACT/COLUMNS=(1:10,18:19,25,41:*) Test.*,[...]*.Tmp!#eof#ww