cut Questions
4
Solved
I need to change the order of a string in AIX, but with the command cut I can't do it
Ex:
echo FT0215202301.xml | cut -b 7-10,5-6,3-4
Result:
02152023
Expected:
20230215
4
Solved
I'd like to get the pid from my processes. I do ps aux | cut -d ' ' -f 2 but I notice that sometimes it gets the pid and sometimes it does not:
[user@ip ~]$ ps aux
user 2049 0.5 10.4 6059216 1623...
13
Solved
Is there a way to specify multiple spaces as a field delimiter with the cut command (something like a " "+ regex)? For example, what field delimiter I should specify for the following str...
6
Solved
I'm trying to extract a certain (the fourth) field from the column-based, 'space'-adjusted text stream. I'm trying to use the cut command in the following manner:
cat text.txt | cut -d " " -f 4
...
8
Solved
I have text like this:
word1 word2 word3 word4
There may be more than one space between a pair of words and I want to get some columns of words from each line . When I use cat file | cut -d ' ' ...
11
8
Solved
I have a file that is HTML, and it has about 150 anchor tags. I need only the links from these tags, AKA, <a href="*http://www.google.com*"></a>. I want to get only the http://www.googl...
2
I am trying to use fzf in the following manner, I would like to be able to search for a term within my codebase and then with the preview window be able to see the file which contains the string I ...
16
Solved
What's wrong with the following code?
name='$filename | cut -f1 -d'.''
As is, I get the literal string $filename | cut -f1 -d'.', but if I remove the quotes I don't get anything. Meanwhile, typi...
Doddered asked 28/8, 2012 at 4:6
3
Solved
I have a numeric vector that I want to convert to five numeric levels.
I can get the five levels using cut
dx <- data.frame(x=1:100)
dx$cut <- cut(dx$x,5)
But I am now having problems extr...
14
Solved
Without using sed or awk, only cut, how do I get the last field when the number of fields are unknown or change with every line?
8
Solved
I have the string as show below:
XXX:Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur cursus lacus sed
justo faucibus id pellentesque nunc porttitor. Sed venenatis tempor dui, ne...
Polychromy asked 8/12, 2011 at 19:28
5
Solved
a.txt contains 500,000 columns and 2000 rows. The example file below only shows the first 9 columns in this file. This file has header in the first row.
chromosome SNPID rsid position alleleA allel...
3
8
Solved
Following some great advice from before, I'm now writing my 2nd R function and using a similar logic. However, I'm trying to automate a bit more and may be getting too smart for my own good.
I wa...
17
Solved
Suppose I have the string 1:2:3:4:5 and I want to get its last field (5 in this case). How do I do that using Bash? I tried cut, but I don't know how to specify the last field with -f.
6
Solved
I need to cut parts from an audio file from position to position. When I tried this command
ffmpeg -ss 132 -t 139 -i original.mp3 new.mp3
it started at the second 132, and added the next 139 sec...
6
Solved
I have a very large tab separated file. The tab separated file is binary and will be streamed by the tool samtools (which is very fast and not the bottleneck). Now I want to output only the content...
Stich asked 4/7, 2022 at 10:15
3
Solved
4
Solved
2
Solved
I want to cut a piece out of a video and burn subtitle in that piece.
I can do this in 3 steps:
cut the video
ffmpeg -ss 25:00 -to 26:00 -i vid.mp4 -c copy out.mp4
cut the subtitle
ffmpeg -i sub...
19
Solved
I am working with two files, and I need to copy a few lines from one file and paste into another file. I know how to copy (yy) and paste (p) in the same file. But that doesn't work for different fi...
Maud asked 6/1, 2011 at 22:30
7
Solved
I've a file with the below name formats:
rzp-QAQ_SA2-5.12.0.38-quality.zip
rzp-TEST-5.12.0.38-quality.zip
rzp-ASQ_TFC-5.12.0.38-quality.zip
I want the value as: 5.12.0.38-quality.zip from the abov...
10
Solved
Suppose I have a Unix shell variable as below
variable=abc,def,ghij
I want to extract all the values (abc, def and ghij) using a for loop and pass each value into a procedure.
The script shoul...
4
Solved
I'm trying to use Unix cut to remove the first two fields per line. I have input lines of of the form
(token)(whitespace)(token)(lots of text)
The problem is that there exit n tokens per line, so...
1 Next >
© 2022 - 2025 — McMap. All rights reserved.