Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

fspec(4) [hpux man page]

fspec(4)						     Kernel Interfaces Manual							  fspec(4)

NAME
fspec - format specification in text files DESCRIPTION
It is sometimes convenient to maintain text files on the HP-UX system with non-standard tabs, (meaning tabs that are not set at every eighth column). Generally, such files must be converted to a standard format - frequently by replacing all tabs with the appropriate num- ber of spaces - before they can be processed by HP-UX system commands. A format specification occurring in the first line of a text file specifies how tabs are to be expanded in the remainder of the file. A format specification consists of a sequence of parameters separated by blanks and surrounded by the brackets and Each parameter consists of a keyletter, possibly followed immediately by a value. The following parameters are recognized: The parameter specifies tab settings for the file. The value of tabs must be one of the following: 1. A list of column numbers separated by commas, indicating tabs set at the specified columns; 2. A followed immediately by an integer n, indicating tabs at intervals of n columns; 3. A followed by the name of a ``canned'' tab specification. Standard tabs are specified by or equivalently, etc. Recognized canned tabs are defined by the command (see tabs(1)). The parameter specifies a maximum line size. The value of size must be an integer. Size checking is performed after tabs have been expanded, but before the margin is inserted at the beginning of the line. The parameter specifies a number of spaces to be inserted at the beginning of each line. The value of margin must be an integer. The parameter takes no value. Its presence indicates that the line containing the format specification is to be deleted from the converted file. The parameter takes no value. Its presence indicates that the current format is to prevail only until another format specification is encountered in the file. Default values (assumed for parameters not supplied) are and If the parameter is not specified, no size checking is performed. If the first line of a file does not contain a format specification, the above defaults are assumed for the entire file. The following is an example of a line containing a format specification: If a format specification can be disguised as a comment, it is not necessary to code the parameter. Several HP-UX system commands correctly interpret the format specification for a file. Among them is which can be used to convert files to a standard format acceptable to other HP-UX system commands. SEE ALSO
ed(1), newform(1), tabs(1). fspec(4)

Check Out this Related Man Page

newform(1)						      General Commands Manual							newform(1)

NAME
newform - change or reformat a text file SYNOPSIS
[file]... DESCRIPTION
reads lines from the named files, or standard input if no input file is named, and reproduces the lines on standard output. Lines are reformatted in accordance with command line options in effect. Command line options can appear in any order, can be repeated, and can be intermingled with the optional files. Command line options are processed in the order specified. This means that option sequences such as yield results different from Options are applied to all files on the command line. Options recognizes the following options: Same as except characters are appended to the end of a line. Truncate n characters from the beginning of the line when the line length is greater than the effective line length (see The default is to truncate the number of characters necessary to obtain the effective line length. The default value is used when with no n is used. This option can be used to delete the sequence numbers from a COBOL program as follows: The must be used to set the effective line length shorter than any existing line in the file so that the option is activated. Change the prefix/append character to k. The default character for k is a space. Same as except that characters are truncated from the end of the line. Write the tab specification format line on the standard output before any other lines are output. The tab specification format line which is printed will correspond to the format specified in the option. If no option is specified, the line which is printed contains the default specification of Input tab specification: expands tabs to spaces, according to the tab specifications given. The tabspec recognizes all tab specification forms described in tabs(1). In addition, tabspec can be in which assumes that the tab specification is to be found in the first line read from the standard input (see fspec(4)). If no tabspec is given, tabspec defaults to A tabspec of expects no tabs; if any are found, they are treated as Set the effective line length to n characters. If n is not entered, defaults to 72. The default line length without the option is 80 characters. Note that tabs and backspaces are treated as single characters (use to expand tabs to spaces). Output tab specification: replaces spaces with tabs, according to the tab specifications given. The tab specifications are the same as for If no tabspec is given, tabspec defaults to A tabspec of means that no spaces will be converted to tabs on output. Prefix n characters (see to the beginning of a line when the line length is less than the effective line length. The default is to prefix the number of characters necessary to obtain the effective line length. Shear off leading characters on each line up to the first tab and place up to 8 of the sheared characters at the end of the line. If more than 8 characters (not counting the first tab) are sheared, the eighth character is replaced by a and any characters to the right of it are discarded. The first tab is always discarded. An error message and program exit occur if this option is used on a file without a tab on each line. The characters sheared off are saved internally until all other options specified are applied to that line. The characters are then added at the end of the processed line. For example, to convert a file with leading digits, one or more tabs, and text on each line, to a file beginning with the text, all tabs after the first expanded to spaces, padded with spaces out to column 72 (or truncated to column 72), and the leading digits placed starting at column 73, the command would be: RETURN VALUE
returns one of the following values: No errors encountered. An error occurred. DIAGNOSTICS
All diagnostics are fatal. was called with a bad option. There was no tab on one line. Self-explanatory. A line exceeds 512 characters after being expanded in the internal work buffer. A tab specification is incorrectly formatted, or specified tab stops are not ascending. A tabspec read from a file (or standard input) must not contain a tabspec referencing another file (or standard input). WARNINGS
normally only keeps track of physical characters; however, for the and options, keeps track of backspaces in order to line up tabs in the appropriate logical columns. does not prompt the user if a tabspec is to be read from the standard input (by use of or If the option is used, and the last option specified was and was preceded by either a or a the tab specification format line will be incor- rect. SEE ALSO
csplit(1), tabs(1), fspec(4). newform(1)
Man Page