Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

fmlcut(1f) [opensolaris man page]

fmlcut(1F)							   FMLI Commands							fmlcut(1F)

NAME
fmlcut - cut out selected fields of each line of a file SYNOPSIS
fmlcut -clist [filename]... fmlcut -flist [-dchar] [-s] [filename]... DESCRIPTION
The fmlcut function cuts out columns from a table or fields from each line in filename; in database parlance, it implements the projection of a relation. fmlcut can be used as a filter; if filename is not specified or is -, the standard input is read. list specifies the fields to be selected. Fields can be fixed length (character positions) or variable length (separated by a field delimiter character), depending on whether -c or -f is specified. Note: Either the -c or the -f option must be specified. OPTIONS
list A comma-separated list of integer field numbers (in increasing order), with optional - to indicate ranges. For example: 1,4,7; 1-3,8; -5,10 (short for 1-5,10); or 3- (short for third through last field). -clist If -c is specified, list specifies character positions (for instance, -c1-72 would pass the first 72 characters of each line). Note: No space intervenes between -c and list. -flist If -f is specified, list is a list of fields assumed to be separated in the file by the default delimiter character, TAB, or by char if the -d option is specified. For example, -f1,7 copies the first and seventh field only. Lines with no delimiter charac- ters are passed through intact (useful for table subheadings), unless -s is specified. Note: No space intervenes between -f and list. The following options can be used if you have specified -f. -dchar If -d is specified, char is the field delimiter. Space or other characters with special meaning to FMLI must be quoted. Note: No space intervenes between -d and char . The default field delimiter is TAB. -s Suppresses lines with no delimiter characters. If -s is not specified, lines with no delimiters will be passed through untouched. EXAMPLES
Example 1 Getting login IDs and names The following example gets the login IDs and names. example% fmlcut -d: -f1,5 /etc/passwd Example 2 Getting the current login name The next example gets the current login name. example% `who am i | fmlcut -f1 -d" "` ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
fmlgrep(1F), attributes(5) DIAGNOSTICS
fmlcut returns the following exit values: 0 when the selected field is successfully cut out 2 on syntax errors The following error messages may be displayed on the FMLI message line: ERROR: line too long A line has more than 1023 characters or fields, or there is no new-line character. ERROR: bad list for c/f option Missing -c or -f option or incorrectly specified list. No error occurs if a line has fewer fields than the list calls for. ERROR: no fields The list is empty. ERROR: no delimiter Missing char on -d option. NOTES
fmlcut cannot correctly process lines longer than 1023 characters, or lines with no newline character. SunOS 5.11 5 Jul 1990 fmlcut(1F)

Check Out this Related Man Page

cut(1)							      General Commands Manual							    cut(1)

NAME
cut - cut out (extract) selected fields of each line of a file SYNOPSIS
list [file]... list [file]... list char] [file]... DESCRIPTION
cuts out (extracts) columns from a table or fields from each line in a file; in data base parlance, it implements the projection of a rela- tion. Fields as specified by list can be fixed length (defined in terms of character or byte position in a line when using the or option), or the length can vary from line to line and be marked with a field delimiter character such as the tab character (when using the option). can be used as a filter; if no files are given, the standard input is used. When processing single-byte character sets, the and options are equivalent and produce identical results. When processing multi-byte char- acter sets, when the and options are used together, their combined behavior is very similar, but not identical to the option. Options Options are interpreted as follows: list A comma-separated list of integer byte option), character option), or field option) numbers, in increasing order, with optional to indicate ranges. For example: Positions 1, 4, and 7. Positions 1 through 3 and 8. Positions 1 through 5 and 10. Position 3 through last position. Cut based on a list of bytes. Each selected byte is output unless the option is also specified. Cut based on character positions specified by list extracts the first 72 characters of each line). Where list is a list of fields assumed to be separated in the file by a delimiter character (see for example, copies the first and seventh field only. Lines with no field delimiters will be passed through intact (useful for table sub- headings), unless is specified. The character following is the field delimiter option only). Default is tab. Space or other characters with special meaning to the shell must be quoted. Adjacent field delimiters delimit null fields. char may be an international code set character. Do not split characters. If the high end of a range within a list is not the last byte of a character, that character is not included in the output. However, if the low end of a range within a list is not the first byte of a character, the entire character is included in the output." Suppresses lines with no delimiter characters when using option. Unless is specified, lines with no delimiters appear in the output without alteration. Hints Use to extract text from a file based on text pattern recognition (using regular expressions). Use to merge files line-by-line in columnar format. To rearrange columns in a table in a different sequence, use and See grep(1) and paste(1) for more information. EXTERNAL INFLUENCES
Environment Variables determines the interpretation of text as single and/or multi-byte characters. If is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty vari- able. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5). International Code Set Support supports both single- and multi-byte character code sets. International code set characters may be specified in the char given to the option. recognizes the international code set characters according to the locale specified in the environment variable. EXAMPLES
Password file mapping of user ID to user names: Set environment variable to current login name: Convert file containing lines of arbitrary length into two files where contains the first 500 bytes (unless the 500th byte is within a multi-byte character), and contains the remainder of each line: DIAGNOSTICS
Line length must not exceed characters or fields, including the new-line character (see limits(5). Missing or option or incorrectly specified list. No error occurs if a line has fewer fields than the list calls for. list is empty. WARNINGS
does not expand tabs. Pipe text through expand(1) if tab expansion is required. Backspace characters are treated the same as any other character. To eliminate backspace characters before processing by use the or com- mand (see fold(1) and col(1)). AUTHOR
was developed by OSF and HP. SEE ALSO
grep(1), paste(1). STANDARDS CONFORMANCE
cut(1)
Man Page