The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
1answer
38 views

Awk to get same column with maximum filed

I have two files. I have to get matching name from file1, print the entire content of file1, and add a fourth column (exp) in file 1 using a second file with max value file1 name value1 ...
1
vote
1answer
86 views

I need to merge multiple .csv files together side by side with unequal number of rows

I have anywhere from 3-5 .csv files and need to be able to merge them together while keeping everything in its respective columns below is an easy example with files with varying number of rows. file1 ...
1
vote
1answer
43 views

How to copy text of virtual terminal from graphics mode?

Linux have virtual terminals, one can switch between them with chvt 1, chvt 7 commands. Former is in the text mode, later is in the graphics mode. I want to copy all the text from first terminal, ...
3
votes
2answers
121 views

Merge and Append columns for more than 2 files

The files are tab separated. I have "N" number of files whose contents are as shown in the screenshot above. I want to merge them and append the 5th column. The first 4 columns are the same. I ...
3
votes
1answer
40 views

Loop through files and join horizontally

I am trying to do the following: Loop through a list of files Edit each file and output a "trimmed" file Horizontally join each trimmed file in turn to a pre-made master file I have steps 1 & ...
0
votes
1answer
57 views

Does anyone know a good pastebin where I can easily pickup the code with curl?

I'm in a domU with nothing but a console to work with an internet connection. I need to configure a file in it that I feel is too long to just type by hand. So I want to pick it up from somewhere ...
1
vote
0answers
49 views

How to use Ctrl+mouse click in tmux?

Due to the change in Tmux2.1, I need to remap my mouse's middle click to tmux's paste: bind -T root MouseDown2Pane run -b "tmux paste-buffer" However, I also would like to enable using Ctrl (or ...
2
votes
1answer
34 views

need help with awk merging rows by sequence from multiple files into one file

have alot of files and need to merge strings between themself by groups of three files. each file ~100-500 rows and result file ~100-200mb seems like awk or sed can help me with paste or without it or ...
1
vote
1answer
163 views

How to merge multiple files based on a timestamp

I have 2 files File 1: 01:12:00,001 Some text 01:14:00,003 Some text 02:12:01,394 Some text File 2: 01:12:00,001 Some text 01:12:01,029 Some text 01:13:21,123 Some text I need output as ...
6
votes
7answers
272 views

How can I apply `cut` to several files and then `paste` the results?

I often do operations like paste <(cut -d, -f1 file1.csv) <(cut -d, -f1 file2.csv) which is very tedious with more than a few files. Can I automate this process, e.g. with globbing? I can ...
5
votes
4answers
130 views

Build table - Add column depending on filenames

I have a huge amount of files having the following naming style: WBM_MIROC_rcp8p5_mississippi.txt WBM_GFDL_rcp8p5_nosoc_mississippi.txt DBH_HADGEM_rcp4p5_co2_mississippi.txt ...
2
votes
2answers
173 views

Paste single-column files with same name using directory name as column name

I have a number of text files that have the same name. Each file is saved in a different folder also each file contains one column of numbers as follow: FILE.TXT FILE.TXT FILE.TXT FILE.TXT ...
5
votes
2answers
412 views

paste files without delimiter

How do I join two files vertically without any separator? I tried to use paste -d"" a b, but this just gives me a. Sample file: 000 0 0 0 0001000200030004 10 20 30 40 2000 4000 ...
1
vote
3answers
286 views

How to copy contents of a (large) vim file to the OSX system clipboard to paste in other apps?

I like to use vim to edit other (non-programming languages) stuff. So I paste the content into vim and make the changes. How can I copy all of the text back into the primary clipboard for pasting? ...
2
votes
1answer
176 views

Format sar samples live with paste and awk

I'm combining live sar samples with paste and trying to format the output with awk live. It works as expected to format the output, but it doesn't do the formatting live on each sample and instead ...
0
votes
1answer
35 views

adding columns to a file with same number of rows

I have a file like this naming it as file1 chr1 24018319 + a chr1 24019249 + b chr1 24020403 + c chr1 24021281 + d chr1 24022398 + e chr1 45241272 + f ...
2
votes
1answer
71 views

Trouble with horizontial merge of csv files under Cygwin

I have two csv files: test1.csv 1 2 3 4 test2.csv 6 7 8 9 I want to horizontally merge these two files. To do this I use paste -d , test1.csv test2.csv > paste.csv If I open this file in ...
1
vote
1answer
34 views

Pasting with vim squeezes content in between previous content and margin

I'm learning my way around the vim and got around to copy-paste. Or yank-paste. Now when I try to paste a yanked piece of text, it pushes previous content to the right and squeezes in on the left. I ...
10
votes
5answers
2k views

Combining large amount of files

I have ±10,000 files (res.1 - res.10000) all consisting of one column, and an equal number of rows. What I want is, in essence, simple; merge all files column-wise in a new file final.res. I have ...
4
votes
6answers
196 views

Join multiple files with two blank lines?

I'm trying to join Markdown files with two newlines between each file. I've tried using the following command: paste -sd '\n\n' file1.md file2.md This joins the files with a newline, but not two ...
4
votes
1answer
182 views

Problem with paste and standard output in linux

I have two files that I am trying to merge, one file is: linux$ cat temp2 linear_0_A_B linear_0_B_A 103027.244444 102714.177778 103464.311111 102876.266667 103687.422222 103072.711111 103533.244444 ...
1
vote
2answers
199 views

Format Column Width with Printf

I have searched online for 10 hours now and tried various codes, but still need help. I am attempting to merge three files using 'paste' and 'awk'. However, the columns are not adjusting to the ...
0
votes
1answer
353 views

How to paste output of multiple commands

I want to merge two unzipped files f1 and f2 in one command, like paste (zcat f1.gz) (zcat f2.gz). What is the right syntax?
3
votes
1answer
5k views

Cut and Paste Commands

So I have: $ cat fruits 2 bananas 3 cherries 4 figs 5 dates 6 elderberries 7 apples 8 grapes and 1 $ cat prices 2 2.18 3 4.11 4 1.69 5 4.52 6 1.73 7 1.01 8 1.09 Every line from 'fruits' ...
4
votes
1answer
119 views

Use paste with row-major input

I can create a file with multiple columns from a single-column input via paste like this: some_command | paste - - This works when some_command produces the data in column-major format. In other ...
2
votes
4answers
154 views

Concatenate different fields with different seperator

I have a tab delimited file like this: chr1 53736473 54175786 chr1 56861276 56876438 chr1 57512145 57512200 I want to concatenate the three fields result like this: ...
4
votes
5answers
755 views

Trying to add a newline to the paste command

Here is the weak attempt at a paste command trying to include a newline: paste -d -s tmp1 tmp2 \n tmp3 \n tmp4 tmp5 tmp6 > tmp7 Basically I have several lines in each tmp and I want the ...
4
votes
2answers
3k views

Select certain column of of each file, paste to a new file

I have 20 tab delimited files with the same number of rows. I want to select every 4th column of each file, pasted together to a new file. In the end, the new file will have 20 columns with each ...
5
votes
5answers
788 views

Replace data at specific positions in txt file using data from another file

I have a text file in the below format: $data This is the experimental data good data This is good file datafile 1 4324 3673 6.2e+11 7687 67576 2 3565 8768 8760 5780 8778 "This is line ...
1
vote
1answer
203 views

Why is the output of this paste command split on separate lines with indents?

I was trying to merge files using either of these commands: paste data_{1..2}.txt > 1_2.txt paste <(awk '{print $1}' data_2.txt ) <(awk '{print $1}' data_2.txt) > 1_2.txt But the ...
1
vote
2answers
637 views

How to use paste command for many files whose names are not numbers? (paste columns from each file to one file)

To paste many files, whose names are incremental numbers: paste {1..8}| column -s $'\t' -t What if your files wasn't named by number, but only words? It can be up to ten files, what should I do? ...
5
votes
2answers
3k views

How to interleave the lines of two or more files?

I have tried to get the 2 files output in a single file. I have tried below command: cat file1 file2 but here file2 data is appending to file1. What I need is file1 1st line followed by file2 ...
4
votes
3answers
699 views

UNIX paste columns and insert zero's for all missing values

I would like to merge specific columns from two txt files containing varying number of rows, but same number of columns (as shown below): file1: xyz desc1 12 uvw desc2 55 pqr desc3 ...
1
vote
1answer
91 views

Wierd output using paste with serial option

I have a testA.txt with contents as shown below [jiewmeng@JM textFiles]$ cat testA.txt The quick brown fox jumped over the lazy dog. paste normally works [jiewmeng@JM textFiles]$ paste testA.txt ...
8
votes
3answers
4k views

paste command: setting (multiple) delimiters

In Linux, I have the following problem with paste from (GNU coreutils) 8.13: Trying to set another delimiter than the default (TAB) results in either just printing the first character of the defined ...
0
votes
0answers
241 views

Gnuplot and process-substitution

I have a log file where I need to cut out two values at different positions. these are: time and dQ in my file. The main problem is the paste I think. cause the other utilities work pretty well on ...
1
vote
1answer
242 views

Vim paste string with non-ASCII characters

I am trying to paste a string from a register in VIM which contains non-ASCII characters such as Ctrlr, how can I paste this string into a file, but escape the non-ASCII characters automatically? ...
7
votes
1answer
5k views

How to merge two files in corresponding row?

Now,I have two files: aaaa.txt: a=0; b=1; c=2; bbbb.txt: d=3 e=4 f=5 I want to merge aaaa.txt and bbbb.txt to cccc.txt. cccc.txt as follow: a=0;d=3 b=1;e=4 c=2;f=5 So, what can I do for ...
7
votes
5answers
3k views

A better paste command

I have the following two files ( I padded the lines with dots so every line in a file is the same width and made file1 all caps to make it more clear). contents of file1: ETIAM...... SED........ ...
0
votes
1answer
204 views

vi / vim - extra indents when pasting text? [duplicate]

I can copy characters in other apps such as browsers with ctrlc. I can then press i to enter insert mode in vim and press shiftctrlv to paste the text in. The problem is that each line gets indented ...