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
0 answers

setFrame crop window

I have a window that should have dynamic height. I have drawn the window in the Interface Builder, and after the calculations in code I try to set the height. It should be also on the same position on the desktop. I use the following code to do…
Lovelace
  • 1
  • 1
0
votes
2 answers

Parse the output of command in a shell script and store the result in a variable

When I execute the following svn command, I get the below output. $ svn log -r 1:HEAD --limit 1 http://plugins.svn.wordpress.org/bulk-delete ------------------------------------------------------------------------ r91525 | plugin-master | 2009-02-03…
Sudar
  • 18,954
  • 30
  • 85
  • 131
0
votes
1 answer

Traversing files using for loop and performing cut command on files

I have four to five files of FOTP_YYYYMMDD_001_01.tsv, FOTP_YYYYMMDD_001_02.tsv, FOTP_YYYYMMDD_001_03.tsv, FOTP_YYYYMMDD_001_04.tsv, FOTP_YYYYMMDD_001_05.tsv with other files in directory, now i have to perform cut operation only on…
0
votes
1 answer

SQL Database to big

I have one question regarding SQL 2005 Database .mdf. I have one database and its more than 290 GB. I need cut this Database and I don’t know how. For example, cut this by Date, take offline in a separate part as 2011-12-31 or older
0
votes
2 answers

Grep and Cut Command and divide string

I have a grep command that gives the following string: 20121121001100 18 0 16 2 18 but I would like to modify this string to get 20121121 001 18 0 16 2 18 the above value are being extracted by the following: for i in `ls -1 file.txt | sort`; do…
mouthpiec
  • 3,923
  • 18
  • 54
  • 73
0
votes
1 answer

Cut string into parts of 2 charactered string and then to hex format (char * to unsigned char) in C

I need some help in cutting a string into a pair of characters and then converting it to HEX format. eg. char *ADDRESS = "0011AABB"; I want the above address to be split "00", "11", "AA" and "BB" and after that is split converting it to 0x00,…
eecs
  • 141
  • 2
  • 13
0
votes
2 answers

Take input via user in order to execute a last and cut command

I want to prompt a user to cut from a 'last' command along with what columns to cut. I also want to use 'tr' to fix all the difference in white spaces. This is the code I have: echo -n "What rows and columns would you like to cut: " read…
demet8
  • 1,089
  • 5
  • 14
  • 26
0
votes
3 answers

Unix/Linux Shell Grep to cut

I have a file, say 'names' that looks like this first middle last userid Brian Duke Willy willybd ... whenever I use the following line=`grep "willybd" /dir/names` name=`echo $line | cut -f1-3 -d' '` echo $name It prints the…
richard008
  • 403
  • 7
  • 15
0
votes
1 answer

bash input/output redirect doesn't work

Can anybody tell me what is wrong with the following bash code for f in $FILES do cut -d, f1-7 < $f > $f.tmp done When I run in the loop echo "cut -d, f1-7 < $f > $f.tmp" I get the right command output and when I run that command by itself, it…
user788171
  • 16,753
  • 40
  • 98
  • 125
0
votes
1 answer

Cocos2D - remove layer opacity on region

I got a Scene with a layer with the top z-index wich one adds a dark effect to the whole scene setting its opacity. What i am trying to do now is to remove the shadow/dark effect in a concrete region (inside a cone/triangle) as the image shows…
Albert Prats
  • 786
  • 4
  • 15
  • 32
0
votes
1 answer

Always disable paste

For a "common" look and feel I have an app that shows the paste/cut/copy buttons in a ribbon but I want to have paste always disabled no matter what field is selected. How do I approach this?
Tony Teveris
  • 165
  • 10
0
votes
1 answer

How to use unix grep and the output together?

I am new to unix commands. I have a file named server.txt, which has 100 fields, the first line of the file is header. I want to take a look at the fields at 99 and 100 only. Field 99 is just some numbers, field 100 is a String. The delimiter of…
runcode
  • 3,533
  • 9
  • 35
  • 52
0
votes
1 answer

BASH CUT associates with CD

i need some help here as i couldn't figure it out the errors. read input echo -e "$input" | cut -c4- cd "$input" | cut -c4- So I enter cd test, echo output is correct which is test. I would like to change directory but it gives cd cd…
Wai Chin
  • 107
  • 1
  • 2
  • 8
0
votes
2 answers

TextField words are cut AS3

I'm having a problem with TextField component cutting the words at the very end of every line, even though the wordWrap property is set to true. example: This is a test te xt, this is a tes t text. This is a test text. How to fix this? thanks EDIT…
astralmaster
  • 2,344
  • 11
  • 50
  • 84
0
votes
1 answer

Comment box half cutoff

My Facebook comment box is cut off half way. I saved this as HTML and opened it with Safari, Chrome and Firefox but they're all half cutoff. How do I fix that? I have been trying for a long time and cannot get it to work. For simplicity's sake, I am…
Ben Lin
  • 11
  • 1
1 2 3
99
100