Questions tagged [cut]

A Unix shell command that breaks input into fields, which can be selected for output, based on a delimiter.

cut is often the easiest way to split input lines or to extract only parts from them. If the rule how to split a line into fields can be expressed with a single character, cut should be used insead of the more powerful tools sed or awk.

cut can select fixed ranges from the input line, be they bytes or characters.

The perfect match for cut is, of course, .

For Prolog's cut, see

In scientific software for statistical computing and graphics, the function cut partitions elements of a numeric vector into bins.

1687 questions
0
votes
1 answer

remove files less than a cetain size and extract filenames

I am working on a cluster remotely and give a few thousands of jobs. Some jobs crash early. I need to move the output files of those jobs (smaller than 1KB) to another folder and start them again. I guess find can move them with something…
maynak
  • 173
  • 6
0
votes
2 answers

shell script for subversion files

The script is not working for "?" case. When i run in command line directly ...works okay but in script is not able to run the "?" condition. svn st svn_promote_WP M svn_promote_WP\Code\Environment\DEV\properties\build.properties M …
iaav
  • 484
  • 2
  • 9
  • 26
0
votes
2 answers

svn log verbose but exclude one revision details

How to get svn log but exclude the branch added information? like in below output of 'svn log -v --stop-on-copy' how to avoid -r101 ? I'm trying to redirect this out to a temp file and just get the files added/modified/deleted details. So just need…
iaav
  • 484
  • 2
  • 9
  • 26
0
votes
1 answer

Issue on text processing using cut command

I have a text file which has a format like this data: [ 142] CPU 10 Nrml Read 4 bytes 0x2a72c08 I want to extract the two hex values in front of v: and p:. As a result I want an output like this …
mahmood
  • 23,197
  • 49
  • 147
  • 242
0
votes
0 answers

Cut a file in parts (without using more space)

I have a very huge file (500GB) to upload, and to easy a bit this task I want to cut this file in pieces. Unfortunately I don't have 500GB free space on my hard drive, so I would like a way to split the file in multiple parts, without needing to…
dvkch
  • 1,079
  • 1
  • 12
  • 20
0
votes
1 answer

How to pass array of arguments in shell script?

Right now i a have a working script to pass 2 arguments to a shell script. The script basically takes a ticket# and svn URL as arguments on command line and gives an output of all the revisions that have been changed associated with that ticket# (in…
iaav
  • 484
  • 2
  • 9
  • 26
0
votes
2 answers

Get only files committed info in svn log -verbose

How to get only the files committed as the output from svn -verbose svn log -v . -r 101 ------------------------------------------------------------------------ r101 | username | 2013-05-10 16:27:55 -0400 (Fri, 10 May 2013) | 1 line Changed…
iaav
  • 484
  • 2
  • 9
  • 26
0
votes
2 answers

I tried various cut commands but unable to get the output I desire

cat DecisionService.txt /MAGI/Household/MAGI_EDG_FLOW.erf;/Medicaid/MAGI_EDG_FLOW;4;4 /VCL/VCL_Ruleflow_1.erf;/VCL/VCL1_EBDC_FLOW;4;4 /VCL/VCL_Ruleflow_2.erf;/VCL/VCL2_EBDC_FLOW;4;4 I tried this: cat DecisionService.txt | cut -d ';' -f2 | cut -d…
iaav
  • 484
  • 2
  • 9
  • 26
0
votes
2 answers

Awk/Cut variable denying further use of mutt?

So I am building a script to check for files with certain errors in a bunch of files, based on output from an SQL DB. The file with the error shall be sent to me via mail. The problem is that when I try to send the mail, I get the message…
Mark Jenster
  • 503
  • 3
  • 6
  • 18
0
votes
2 answers

BASH: Using cut on space delimited file: Treating two spaces as one

I need to convert file full of lines like this: # 2007 4 29 10 1 17.98 blah other stuff into lines formatted like this 2007.04.29.10.01.17 The original line is space delimited, and when a one's place digit number appears (such as 4) it gets…
Brian C
  • 1,333
  • 3
  • 19
  • 36
0
votes
1 answer

Using cut into a shell script with variables

I am using cut to eliminate last two characters of a file: cut -c1-40 outfile Before, I have used wc to know the number of characters in the file: wc -c inputfile Now I would like to use this information to write a shell script First I…
none given
  • 3
  • 1
  • 3
0
votes
2 answers

sed command to beautify output of an awk command

i have the following output from an awk command..i want to beautify output as follows..is there an sed command that will give me the expected output? CURRENT OUTPUT:- https://code-comp.com/308271 (there is white…
carte blanche
  • 10,796
  • 14
  • 46
  • 65
0
votes
1 answer

awk search command for case-insensitivy

I have the following awk commmand..i want to make "issue-Fixed" as case-insensitive,can anyone provide inputs on how this can be done,i looked at http://www.unix.com/shell-programming-scripting/20196-case-insensitive-serach-awk.html but this doesnt…
carte blanche
  • 10,796
  • 14
  • 46
  • 65
0
votes
3 answers

Cut NSString from space to end

I have NSString: sessid=os3vainreuru2hank3; __ubic1=MzcxMzjMDYuNjk0NDA1Mzc%3D; auto_login=123; sid=kep8efpo7; last_user=123; I need get just: __ubic1=MzcxMzjMDYuNjk0NDA1Mzc%3D; auto_login=123; interpals_sessid=kep8efpo7; last_user=123; But…
Alexander
  • 627
  • 2
  • 11
  • 23
0
votes
2 answers

GREP - What language is Linux / Unix utilities written in?

I was curious as to which language was utilities built into the Linux kernel was written in such as grep, cut, awk, find etc. Are these compiled and can not be cat'ed and viewed?
RedHatcc
  • 3,016
  • 4
  • 16
  • 13