Questions tagged [cut]

cut is a Unix command line utility which is used to extract sections from each line of input.

Filter by
Sorted by
Tagged with
0
votes
0answers
39 views

ffmpeg: cut live rtsp from ipcam in sync (strategy)

A process with ffmpeg captures the streams in rtsp (audio and video) from different ipcam with microphone through the following commands: ffmpeg -stimeout 5000000 -rtsp_transport tcp -i rtsp://admin:...
1
vote
2answers
40 views

Notepad++ cut certain field just like Linux cut or awk command

Here is the sample file wolf@linux:~$ cat notepad.txt 1 - abc 2 - def 3 - ghi wolf@linux:~$ In Linux, it's easy to remove everything before - by using cut or awk command. E.g. cut wolf@linux:~$ ...
0
votes
1answer
31 views

Sort lines in file by first field treated as number in shell

I have a file with the format shown below (a number + an IPv4 address). This format was generated by using uniq -c. I want to sort the lines after the first number in each of them. I would've gone for ...
2
votes
0answers
45 views

Is it possible to find piece of audio inside of mp3 file?

We have a community radio and we are recording all shows 24/7. And we are wondering is there any way to automatically trim those recordings so that all commercials and unwanted parts are cutted off ...
0
votes
1answer
66 views

How to cut video resolution from 3840x2160 to 2184x1680 in VLC

So I have a video 3840x2160 resolution and I want to cut out a part of it. So I'd only have the upperleft 2184x1680 pixels. Can that be done in VLC?
1
vote
1answer
49 views

Cut out the start and end of a .mp4 file

I have been using ffmpeg to remove the first 5 seconds of a video clip with the following code. for %%a in ("*.mp4") do ffmpeg -i "%%a" -ss 05 -acodec copy -vcodec copy "newfiles\%%~na.mp4" pause Is ...
0
votes
1answer
1k views

Precisely cut videos with ffmpeg [duplicate]

I would like to cut videos using ffmpeg for machine learning. How can I ensure that if I cut (for example) 1s of video @25fps this will provide exactly 25 frames of synchronized audio and video? I ...
1
vote
1answer
2k views

Using 'cut' command on Windows

I am trying to run this command line on Windows (I've installed GNU coreutils 8.24) echo android:versionCode="3267" | cut -d \" -f 2 Expected output: 3267 However, I am getting error: cut: the ...
1
vote
1answer
53 views

How to extract all strings in require('')?

My source files are something like this: abl require('../img/a.png') require('../img/b.png') bla require('../../img/c.png') ble <Image source={require('../img/d.png')} My expected output is: '../...
0
votes
0answers
512 views

cut: you must specify a list of bytes, characters, or fields

x=`sudo find /test -name "*.php"` echo $x p421.php p423.php read-session.php I want to cut the $x with space white as delimiter echo $x|cut -d " " cut: you must specify a list of bytes, characters,...
2
votes
1answer
6k views

Move all the files and folders with CMD (BAT File)

I want to move all the files and folders inside the folder "C:\Foldertest\" into the folder "C:\Foldertest\target". And whenever I run this command, it does this for all files and folders except for ...
1
vote
0answers
922 views

Is it possible to cut mp3 file with Audacity without losing any quality (recording, etc.)?

I want to cut mp3 files with Audacity without losing any quality (recording, etc.). I am aware of other options but I want to do it with Audacity if possible because I use it for other things too.
-1
votes
2answers
145 views

find number of teams from a file [closed]

I have started learning bash very recently and have to find the number of teams from a file, the file can be downloaded from this link. Below is a sample I understand that I have to use cut and uniq ...
1
vote
2answers
3k views

Black frames at beginning of video file when file cut

I use ffmpeg to cut a video file. The format i use is this: ffmpeg -i input.avi -ss 00:06:30 -to 00:07:15 -c copy output.avi Unfortunately this leaves some black frames in the beginning of my output ...
0
votes
2answers
85 views

In excel 2010, pushing ctrl+x will delete the highlighted words. They are not saved to the clipboard. Can't be recovered with undo. Why?

UPDATE: This only seems to happen when I push Ctrl+X, then Ctrl+C after. This will erase the cut from the clipboard and Ctrl+Z will not undo the cut. When I am editing text (in this case, Japanese ...
1
vote
1answer
519 views

Use section sign § as cut delimiter

I thought this would be pretty straight forward echo "1§2" | cut -d § -f 2 should give "2", right? But whatever I try echo "1§2" | cut -d § -f 2 echo "1§2" | cut -d \§ -f 2 echo "1§2" | cut -d "§" ...
2
votes
1answer
1k views

Printing all columns after 5th with awk

I'm using this to filter a logging file and I'm trying to squeeze as much relevant detail as I can onto the console: awk -F " " '{$1=$2=$4=$5=$6=$7=""; print $0}' This is my raw input: 149.177.5....
0
votes
0answers
217 views

awk and cut on a very large file

I have to extract a column of data from a very large file >100GB. I know how to use the awk and cut commands do it, but would like to know if one is more efficient (from a speed perspective) for ...
1
vote
1answer
2k views

Cut part of every line in file possible?

I need to cut/copy part of lines only - is this possible in notepad++? See image for (maybe) better explanation - I need to cut/copy the blue square. Thanks
0
votes
1answer
63 views

Audacity | Split | duplicate split-positions onto another layer

Audacity_2.1.2 win10_Home_x64 AUDACITY How to do a split Edit -> Clip-Boundaries -> Split depending on whether it's a point vs. selection CTRL-I Point vs. Selection Point A point will only ...
0
votes
1answer
305 views

Cut Video with FFmpeg

I have a video 20 muminute long time, I want to cut the first 5 minutes and 5 minutes of video finally. I have to use commands like, can help me? I user commant here: ffmpeg -ss [start_seconds] -i [...
0
votes
1answer
468 views

how to filter text file on the basis another text file

I have two text files. One is wordlist and another one is file to be filtered. I want to remove or delete all the lines or links from the file if the line has any word from word list anywhere in the ...
-1
votes
1answer
54 views

How can I filter a list of files to download those that don't already exist?

I have downloaded some files into a folder, but the download was interrupted and not all the files were downloaded. I do not want to redownload the gigabytes-worth of files I already have; I now want ...
3
votes
1answer
6k views

How to `cut` (extract a subset of columns) a CSV file that contains quoted strings`

I have a CSV file and want to discard a couple of columns. So let's say this is a sample file: column a, column b, column c value a, value b, value c value a, "quoted, b", value c And now let's ...
5
votes
1answer
7k views

How to echo only 1st line from 'curl' command output?

I'm trying to get only first line of the curl command output. (Sorry if this is confusing) Let's say, for an instance, i run simply: # curl http://localhost <!-- This is the hidden line i want to ...
0
votes
4answers
1k views

Which program I can edit video (cut some scenes) without increasing the video's size

I have a video: Input.mp4 - length: 29 min 6 sec - size: 120 MB I use Microsoft Movie Maker 2012 (Movie Maker is included in the Windows Essentials 2012 program suite), to cut some boring scenes and ...
0
votes
3answers
5k views

cut: |: No such file or directory

while read line do echo $line calendar_date=$(cut -d\ -f1 $line) hr_of_day=$(cut -d\ -f2 $line) echo "date: $calendar_date hr: $hr_of_day" done < $FILE I ...
1
vote
1answer
3k views

Error with command cut: the delimiter must be a single character

I am trying to run this command from console: # HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` But got this error: Try `cut --...
0
votes
1answer
1k views

need to get average idle time using mpstat

I want to get average idle time of the server using mpstat. The problem I am having is %idle is not in same columns in all the versions of linux. example 1: [root@testserver ~]# mpstat 1 2 Linux 2....
0
votes
1answer
180 views

Piping a line of the file read with while read loop

I am trying to read each line of the file and then assign some parts of it to variables. A line itself is read as a variable so I need to process a variable input say for cat which seems to be ...
1
vote
1answer
269 views

Cut lies if delimeter doesn’t exist

For example: $ cut -d ' ' -f 2- <<< "example" example Why does cut lie to me telling me that “example” is the second delimeter and on. I want it to print "" since there is no second ...
1
vote
1answer
541 views

Cutting out two parts from the middle of a video with ffmpeg

I have two files, rec.avi and audio_edited.wav, and what I'm trying to do is take the parts 00:30:50–01:42:56 and 02:16:55–04:03:10 of each file, concatenate those and encode them into an WebM file. ...
2
votes
1answer
2k views

How to Extract Multiple substrings from Log FIle

I am trying to extract the timestamp and the number string in the URL called in an apache logfile that looks like this: 123.456.78.90 - - [16/Dec/2014:06:27:30 +0100] "GET /servlet/something....
1
vote
2answers
71 views

How to retrieve a name from another file with a Bash script?

I would like to grab a name out of another predefined file and use it within my shell script. The file being read would be in ./docs/description.org and the format (a table in .org format) is: ......
1
vote
1answer
2k views

Cut - the delimiter must be a single character

I am trying to cut the information from a variable of a variable. I am using csh. Ex: setenv time \`date | cut -d ' ' -f 4\` echo $time setenv hour \`$time | cut -d \':\' -f 1\` echo $hour Output: ...
1
vote
1answer
75 views

Cutting input with cut or awk?

I'm basically trying to parse raw IRC input with a bash script, and I want to grab the messages, and nothing else. An example of what I'm trying to save is :user!~name@host.name PRIVMSG #channel :...
4
votes
2answers
1k views

Bash command substitution not working as expected

I'd like to view the last few lines of a file, but I want the columns aligned. Basically, I want to disable wordwrap. This is straightforward with: tail $FILE | cut -c -80 But I'm trying to ...
2
votes
1answer
591 views

Inconsistent results using cut on output of ls

I am struggling to understand why I get different output from the same command run on a single file in Terminal (Mac OS X 10.6.8) and run on more than one file. As I want to run the command in a bash ...
2
votes
3answers
8k views

In bash, how do I pass the while loops input to the cut command?

How do I pass the $line to the cut command properly in this loop? while read line do login= $(cut -d : -f 1) done < /etc/passwd I can't do $(cut -d : -f 1 $line) so what is the correct way?
1
vote
1answer
5k views

How to use cut command in UNIX?

I have a really large text file (~80 Million records/lines), where each record has 7 attributes. Between every attribute there is a tab. What I want to do is copy every third and last attribute/token ...
1
vote
5answers
8k views

How to grep column after second pipe

Example: 3|100|test@test.com|0|0|6:1,10,11,12,13,2,3,4,5,6,9|7:1,10,11,13,16,2,4,5,6,9| Expected view after grep: test@test.com
2
votes
1answer
8k views

Add character at certain position in line

I've encountered the following problem: I need to add space at certain position in each line, to transform data from ATOM 1 HT1 GLY 5 10.346 30.927 130.252 0.00 0.00 to (by adding ...
3
votes
1answer
4k views

GNU sort and git blame

Today I thought I was doing a simple operation: git blame file | sort -k 3 To get all the lines of file sorted by the date on which they were last changed. Unfortunately it doesn't seem to be ...
0
votes
2answers
3k views

chained commands to create directories on a remote server

To get rsync cronjob working, I need to first create the dir tree on the remote server before running rsync. The local directories shall mirrored (w/o content) to the remote server. I'm strugglying to ...