01-18-2016
BTW some versions of cut has -F option that folds adjacent delimiters into one
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I wanted to cut the feilds comming after % and After $ at one go
can we do some thing like this cut -f 2 -d "%|$" (But it doesnot work)
Input File
BWPG %TCPRP1 $SCSPR000
BWPH %TCPRP1 $SCSPR003
BWPI %TRTYUP ResourceDescription="IMPRIMANTE " $BWOPTY
BWPJ %ZOMBIE ... (4 Replies)
Discussion started by: pbsrinivas
4 Replies
2. Shell Programming and Scripting
I'm working on formatting some attendance data to meet a vendors requirements to upload to their system. With some help on the forums here, I have the data close. But they've since changed what they want.
The vendor wants me to submit three fields to them. Field 1 is the studentid field,... (4 Replies)
Discussion started by: axo959
4 Replies
3. Shell Programming and Scripting
I just discovered, to my dismay, the following part of the cut man page:
-f, --fields=LIST
select only these fields;
also print any line that contains no delimiter character, unless the -s option is specified
The -s option toggles the printing of lines with no delimiters.
In most... (3 Replies)
Discussion started by: chlorine
3 Replies
4. Shell Programming and Scripting
Hi All,
I am trying to cut to do a cut operation, but since there are seems to be more than one deltimiters in some occasion I am not able to get the exact field. Can you please provide an SED and AWK script for treating the source file in such a way that all consecutive delimiters are treated... (3 Replies)
Discussion started by: rakesh.su30
3 Replies
5. UNIX for Dummies Questions & Answers
I'm having bother getting both lines contained in a file to output as the same value.
A simple example:
john:123456:123:456:doe
john:123456:123:doe
cut -d: -f1,4 input file
john:456
john:doe ^ first line should be same as second.
trick one for me, i know why it's because of the... (4 Replies)
Discussion started by: landofus
4 Replies
6. Shell Programming and Scripting
Hi,
I have a input file which contains following data
0 1
0 2
0 3
0 4
0 8
0 9
0 11
1 1
1 2
1 6
1 7
1 8
1 9
2 1
2 11
2 12 (12 Replies)
Discussion started by: Ryan Kim
12 Replies
7. UNIX for Beginners Questions & Answers
I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
Discussion started by: scrutinizerix
9 Replies
8. Shell Programming and Scripting
Hi All,
I have a file with a single row having the following text
ABC.ABC.ABC,Database,New123,DBNAME,F,ABC.ABC.ABC_APP,"@FUNCTION1("ENT1") ,@FUNCTION2("ENT2")",R,
I want an output in the following format
ABC.ABC.ABC DBNAME ABC.ABC.ABC_APP '@FUNCTION1("ENT1")... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies
9. UNIX for Beginners Questions & Answers
I have a text file with many thousands of lines, a small sample of which looks like this:
InputFile:PS002,003 D -1 5 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 6 6 -1 -1 -1 -1 0 509 0
PS002,003 PSQ 0 1 7 18 1 0 -1 1 1 3 -1 -1 ... (5 Replies)
Discussion started by: jvoot
5 Replies
10. Shell Programming and Scripting
BASH : I have a very long list I am parsing through:
10/10/19... (5 Replies)
Discussion started by: jeffs42885
5 Replies
CUT(1) User Commands CUT(1)
NAME
cut - remove sections from each line of files
SYNOPSIS
cut OPTION... [FILE]...
DESCRIPTION
Print selected parts of lines from each FILE to standard output.
With no FILE, or when FILE is -, read standard input.
Mandatory arguments to long options are mandatory for short options too.
-b, --bytes=LIST
select only these bytes
-c, --characters=LIST
select only these characters
-d, --delimiter=DELIM
use DELIM instead of TAB for field delimiter
-f, --fields=LIST
select only these fields; also print any line that contains no delimiter character, unless the -s option is specified
-n (ignored)
--complement
complement the set of selected bytes, characters or fields
-s, --only-delimited
do not print lines not containing delimiters
--output-delimiter=STRING
use STRING as the output delimiter the default is to use the input delimiter
-z, --zero-terminated
line delimiter is NUL, not newline
--help display this help and exit
--version
output version information and exit
Use one, and only one of -b, -c or -f. Each LIST is made up of one range, or many ranges separated by commas. Selected input is written
in the same order that it is read, and is written exactly once. Each range is one of:
N N'th byte, character or field, counted from 1
N- from N'th byte, character or field, to end of line
N-M from N'th to M'th (included) byte, character or field
-M from first to M'th (included) byte, character or field
AUTHOR
Written by David M. Ihnat, David MacKenzie, and Jim Meyering.
REPORTING BUGS
GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report cut translation bugs to <http://translationproject.org/team/>
COPYRIGHT
Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
Full documentation at: <http://www.gnu.org/software/coreutils/cut>
or available locally via: info '(coreutils) cut invocation'
GNU coreutils 8.28 January 2018 CUT(1)