Questions tagged [split]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
22 views

How can I split a string containing a Bash command without expanding parameters?

I have a single string that contains a shell command line. I need to remove a specific argument from this string (if present), and print the result, while keeping it a valid shell command. How can I ...
0
votes
0answers
6 views

Play video full screen in a split window on KDE

Is there any way to play video full screen on a split window on KDE? My current split windows look like this. What I want to do is I want to play the video on full screen in a split window like this. ...
-1
votes
0answers
41 views

Split: bucketing hugefile and send it to jq

I need to bucket single text file into chucks of n lines in order to send it to another third tool. I imagine something like that: $ bucket hugefile.csv -size 15 | jq -f build-bundle.jq > bundle-xx....
16
votes
1answer
2k views

Splitting a small file into 512 byte segments changes it, but splitting it in 1k segments doesn't

So I'm trying to split a 64MB file FileCarve.001 into 512 byte segments (each block is 512 bytes long). I need to make sure the file has the same data when split into smaller files, so I cat all the ...
0
votes
1answer
38 views

How to forward output of split to sftp?

I have a server that is running out of disk space. I want to move some TB sized directories into a long term archive. This is a tape robot with preferred file size of 16GB. Therefore I want to split ...
3
votes
0answers
343 views

Split ultrawide monitor in 3 virtuals screens

For my work, I try to split my new ultrawide monitor in 3 virtual screens on Ubuntu (I don't want to use tile tools as gTile). My first test using "xrandr" was OK when I selected "xorg&...
1
vote
1answer
49 views

How to split, add text for each split and gzip file

I want to take a huge file data.txt and: Split it by 256m Add the first 3 lines of data.txt to each split file gzip it data.txt looks like: aaa bbb ccc <data> <data> <data> ... <...
3
votes
3answers
603 views

I don't really understand expansion and quoting on the shell (zsh/bash)

I've read up on a few answers here in reference to quoting variables on the shell. Basically, here's what I'm running: for f in "$(tmsu files)"; do echo "${f}"; done this has the ...
0
votes
2answers
123 views

Split a file into multiple files, using the first X positions of a line, using sed or awk

I have a large text file, containing up to 2300 sections. Each section begins, one line before, "PAGE 1" The page number is at very end of the line, Example: T5271-AX1 TITLE ...
1
vote
1answer
75 views

Is it with GNU parallel possible to split on character count, but provide full lines only?

I would like to split an input file on character count (ASCII is fine), combined with new lines as well. That is, every group of 10000 character should be seen as one record to be piped into the child ...
-1
votes
1answer
38 views

I want to replace a specific word in a text file and save the results in multiple text files using perl or ubuntu command?

I have a file results.txt that contains the following: the word: word1 is a not detected And I have a txt file contain the list of words as following: word1 word2 word3 ... And I want to generate ...
1
vote
2answers
228 views

Automating the splitting of a large mp3 file with FFmpeg into multiple files in different time points provided in a text file

I have a large mp3 file; I want to split it into 480 mp3 files in different time points. I want to know if there is an easy way to do it other than splitting it one by one. Can I provide the different ...
0
votes
1answer
67 views

Use output of cat with split command and specified output directory

I'm trying to split a long csv into files of 500 lines each. I want the output files in a specific directory, and I want to leave off the first line of the csv. I can use split and leave off the ...
0
votes
1answer
57 views

Using split() with awk

I am trying to use split() with awk. I am splitting the contents of $7 with split() into an array, but not sure how to print the contents starting from reverse order. The field $7 is of variable ...
0
votes
1answer
30 views

Less, but only last element of every line?

So, I want to monitor live logs as they come with less +F, but the logs have a LOT of noise before the actual message - fortunately the line is segmented by | character, with the timestamp being ...
4
votes
1answer
129 views

Save current vim session state and restore it later (e.g. buffers, splits etc.)

As an old VIM user, attracted to it in the first place especially because of its straightforward regex substitutions that allow to work really fast, I'm not really expecting VIM to have such a feature....
1
vote
3answers
329 views

streaming split/merge command?

Does a streaming version of split exist somewhere in Linux? I'm trying to back up a large amount of data via SSH, but SSH's single threaded encryption is limiting the transfer. This machine doesn't ...
0
votes
1answer
40 views

how to get split commands output to file

I want to print output of below command to file, can you help me I tried 2>&1 even 2>> also dd if=/dev/random bs=1 count=1000 status=progress |split -b 10 -a 10 I have other dd command ...
1
vote
1answer
63 views

How to create folders based on part of a filename and also extract & rename specific columns using awk

the following code extracts data from csv files contained in a folder, creates new folders (based on filename and date), creates and stores multiple csv files in the said folders. more info on this is ...
4
votes
2answers
859 views

How to split CSV file and create multiple CSV files based on a column

I have a csv file with the format: Input.csv: TIMESTAMP,Data1,Data2,Data3,Data4 "2021-01-03 00:00:00",80953,3.243183,2.943338,358.0123 "2021-01-03 00:01:00",80954,2.173187,1.990327,...
0
votes
0answers
86 views

I have a `raspivid` stream, which I'm piping to `ffmpeg`, now i'd like to also stream a raw version of it to a socket?

I have a process outputing an MJPEG video stream, which I pipe into ffmpeg to reduce framerate and then to a socket. raspivid -t 999999 -cd MJPEG -w 1920 -h 1080 -o - | ffmpeg -i - -f mjpeg -r 2 - | ...
1
vote
0answers
59 views

Can GNU tar run a filter before adding a file to an archive?

I am trying to archive a directory containing many subdirectories and files, most of which are JPEG files. I would like to run each file through JPEG XL before adding to the tar archive, to reduce ...
-1
votes
3answers
125 views

Bash Split Output Groups to Columns

I have similar output like below goes so long. I want to create columns with this output but with like groups/blocks. And process output after a pipe. id: c2b751c227111edfgdghfhfg19079a466e1916f6df4 ...
2
votes
1answer
346 views

Split large file into chunks and delete original?

I'm having trouble with a large text file (30GB) I would like to create smaller files from it (5GB lets say) But sadly I don't have no more storage (only ~10G is available). This line: split -b 5g &...
1
vote
2answers
169 views

How to create split tar archive in multiple stages to save space?

I have a very large folder that I am trying to create a tar archive of. The issue is I don't have enough extra free space to store the entire archive so I want to create say 100-200GB chunks of the ...
0
votes
0answers
207 views

Split command to chunk a large CSV - with new line character

I'm splitting a large CSV file with small chunks using the split command. Each file should contain 1000 rows only. The command I used is, cat large.csv | split -a3 -l1000 --filter='gzip > $FILE.gz'...
0
votes
1answer
129 views

Split file from a streaming output with custom name and gzip

I have a script with a while loop that will print a text. I want to save it into files with custom name. Script: #!/bin/bash while true do echo "Press [CTRL+C] to stop.." done I can run ...
4
votes
1answer
223 views

Split large files into a number of files in unix

i have a file that contains several lines(9074 line), i want to split the file into 10 files contain the same number of lines except the last file that contain the remainder number of lines split -l `...
-1
votes
1answer
308 views

linux + how to split ISO file to separate pieces [duplicate]

we are using the following ISO file for rhel upgrade 4.2G RHEL-7.6.iso since we have problem to copy this ISO file between WIN to Linux machine and that because sometime network problem cause ISO ...
2
votes
2answers
211 views

Split long SQL expression at delimiter

Context I'm trying to import a dump that have some long lines (8k+ character) with SQL*Plus, so I face the error SP2-0027: Input is too long (> 2499 characters). This is a hard-coded limit and ...
0
votes
1answer
39 views

How to split single rows of a CSV file into multiple depending on delimiter in 2nd column

My base.csv file has several entries a sample of which is below. NAME,IP_ADDRESS,PRI_IP,APP_CODE,APP_NAME,OWNER test2,10.9.7.12/10.222.101.11,10.9.9.12,545,myapp1,owner1 mytest,10.9.7.12,10.9.9.12,545,...
2
votes
1answer
45 views

Piped split command not executing

Rather straightforward question that I'm stumped on. I have a command line utility called twarc that I am executing. This can build rather large files. I would like to leave this running and ...
6
votes
2answers
830 views

awk: split file by column name and add header row to each file

I have a pipe delimited file a.txt which includes a header row. The first column holds a filename. I would like to split a.txt into several different files - the name of which is determined by the ...
1
vote
1answer
306 views

Opening multiple screens in a linux terminal using a script or command

I want to open screens vertically and horizontally. I have used the following: tmux ctrl + b then % ctrl + b then " screen ctrl + a then S ctrl + a then | But, is it possible to open a screen ...
0
votes
0answers
404 views

Split csv file on multiple csv files based on several columns headers

I have a large csv file that i tried to split into several csv files based on certain columns in the header. The objective is to generate each file in relation to the columns of the country. For ...
-1
votes
2answers
1k views

How do i split my tar.gz into multiple files in a single exec command? [duplicate]

I don't know anything about Unix/Linux. I am primarily a web programmer. I am running the following command in my code: exec("tar -caf '/backups/_structure.tar.gz' --ignore-failed-read -C /source ...
2
votes
2answers
1k views

How to split text files by character count in directory

I would like to divide multiple text files in a directory into many smaller text files by a given character count. For example, I want each file in the directory to be divided into smaller text files ...
2
votes
3answers
1k views

Using regex with IFS variable to split Bash string

I am trying to split a string into an array by any character that is not alphanumeric. Can assign a regex pattern to the IFS variable to accomplish this? I have tried it like so: input="$1" ...
0
votes
2answers
38 views

split output into 2 columns based on number of rows

I have the following output: Column1 1.2.3.1 1.2.3.2 1.2.3.3 1.2.3.4 1.2.3.5 1.2.3.6 Column2 1.2.3.7 1.2.3.8 1.2.3.9 I would like to split into 2 columns once it reaches Column2. For example: ...
2
votes
2answers
313 views

Awk - Split each byte to their own file while specifying created filename to stdout

I have huge files (multiple gigabytes, etc) and while i tried many different tools (split, etc) but for my own needs i need to do this in awk. Basically, i want to emulate what split -b 1 file does (...
1
vote
2answers
597 views

How can I batch rename text files to be the first word in each text file?

I need to rename a few thousand text files to be the first word in the text file plus the file extension (.txt) using the terminal. All the files are in a single directory, and are currently named int ...
1
vote
1answer
147 views

How can I split command stdout into sections, one for each file?

When a Linux command gets multiple files as input. Is there any command/trick to split command's stdout into sections. One for each file? So, it becomes visually clear which lines belong to which file?...
1
vote
1answer
145 views

How to divide a file to different subdirectories

I have a file that contains a story. I need to split the file in a way that each chapter (chapter starts with the word 'chapter') will be in diffrent directory. CHAPTER count as- everything that ...
0
votes
1answer
557 views

Split file based on beginning and end XML tag

Can split be used to split a file into multiple segments where the size of each segment is based on the number of matches of an XML element ? For example for below XML split when encounters of "<...
0
votes
3answers
96 views

Split a string by multiple delimeters in bash

There's a string: onetwothree.file.001.txt ; threefourfive.file.0.98.txt ; fivefoursix.file.14.txt I want to split it by . and ; removing the prefix before the filename, so that it looks like this: ...
-1
votes
1answer
328 views

what is the best approach to Join Tar files after Splitting [closed]

we have the following files , that we split from huge tar file linuxaa linuxab linuxac . . . note - we have only files with linux[a-b][a-z] and linux-xxxx or linux_xxx , but we want to compress ...
1
vote
0answers
66 views

How can I concatenate thousands of files into a single device

I'am using split to cut a an iso into multiples chunks. Then a can use cat to rebuild initial iso that I can convert into a mountable device with losetup and then mount. The problem is when initial ...
0
votes
0answers
40 views

Split a file into 8 files depending on the number of records

I have a file with 10K records and I need to divide it into 8 files. I used split -n l/8 -d file1 file2. This will split the file into 8 files, but I need to divide the file into 8 depending on the ...
1
vote
2answers
1k views

Split text separated by lines starting with semicolon

I have the output from a command (plantuml -language; see List of keywords, predefined names, symbols for codeless language module for BBEdit? for the background) which effectively looks like this: ;...
0
votes
2answers
132 views

Script in Bash: Find all files

I want to write a script in Bash which finds all files less than 100b in /etc directory, splits the results on pages and saves the results to a file. I tried to use this command: find /etc -size -...

1
2 3 4 5 6