paste command without spacing?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers paste command without spacing?
# 1  
Old 03-09-2012
paste command without spacing?

I'm trying to combine text files without a space. So if i use the paste command

paste file1 file2 file3 > file4

the new file created has spacing between the contents of the once individual files. Is there some trick I can do with a delimiter that removes the spaces.. like paste -d'' or something? or would I need to use awk or something to remove the spacing?
# 2  
Old 03-09-2012
Code:
awk '{arr[FNR]=arr[FNR} $0; mx=(mx>FNR)?FNR:mx} 
        END {for(i=1;i<=mx; i++){print arr[i]} }' file1 file2 file3  > newfile

try that

Last edited by jim mcnamara; 03-09-2012 at 09:22 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issue with paste command

Hi, I am facing issue with paste command. It is adding spaces or tab in between. I have say 3 files with below data File_1 TH THI THIS I File_2 IS IS S IS RE S File_3 RECORD 1 CORD 2 IS RECORD 3 (3 Replies)
Discussion started by: Simanto
3 Replies

2. Shell Programming and Scripting

Need help with paste command using variables

How can I accomplish this? I basically want to merge two variables onto the same line. I can do it with two FILES this way: $ cat /tmp/users_in.list | awk -F "," '{print $2}' | cut -c -1 > first.initial $ awk -F "," '{print $1}' /tmp/users_in.list | awk '{print $1}' > last.name $ paste... (5 Replies)
Discussion started by: greenlightening
5 Replies

3. Shell Programming and Scripting

How do I use paste command in while condition??

there are lot of files where in mostly all the file contains 2columnsAl,1 Ail,13 Al,3 Al,1 Al,3 Al,2 Al,3 Al,1 Al,1 Al,1 My requirement is i wanted only the second column of every file as a column ony in the base file... I used paste command... but it is not helping as I'm using while... (7 Replies)
Discussion started by: nikhil jain
7 Replies

4. UNIX for Advanced & Expert Users

Paste command formatting

Hi, I was trying to concatenate some files using paste command along with some formatting but getting stuck. The problem is: cat 1.txt A cat 2.txt B C cat3.txt D E cat 4.txt G H (5 Replies)
Discussion started by: abhi1988sri
5 Replies

5. Shell Programming and Scripting

Paste command - question

Hi, Below file content is output from pasting two files. Now, i want to output another file which just contains the difference on any line For example: JAY,2,,3,5,B+,JAY,2,,3,5,B+ ANN,5,,5,1,C,ANN,5,,5,2,C Line JAY seems to have no difference. However, line ANN has difference in on... (3 Replies)
Discussion started by: jakSun8
3 Replies

6. Shell Programming and Scripting

Can't paste in command line.

Hello. I've made a simple script which asks the user to input a hash and then runs a command that replaces the variable $hash with what the user inserted. The ting is that when the programm asks for input I can't paste anything there..! any clues?? :wall: (8 Replies)
Discussion started by: louboulos
8 Replies

7. Homework & Coursework Questions

Join command help with spacing

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I have to join 3 files numerically according to ID(first column) with no comments. In the end i'll be something... (0 Replies)
Discussion started by: bigubosu
0 Replies

8. UNIX for Dummies Questions & Answers

paste command

input1 15 150 input2 x 10 100 input3 y 20 200 z 34 44 cmd paste -d "\t" input1 input2 input3 >>output output (1 Reply)
Discussion started by: repinementer
1 Replies

9. UNIX for Dummies Questions & Answers

Question on Paste command

Hello everyone, This is Rameshreddy. I like this forum and its nice to share everyone's experience here and one can learn a lot from here. Appreciate the moderators especially. Coming to my question i have 2 files and i want to paste them with specific number of tabs as delimiters... (4 Replies)
Discussion started by: mudhireddy
4 Replies

10. UNIX for Advanced & Expert Users

paste command

I wonder if any body can help me with a command i am struggling with. I have a file with around 400 lines in, in a program i have it pulls out each line at a time so that data from the line can be cross referenced with another file. If it finds a match it pulls out a ocde from the second file, this... (5 Replies)
Discussion started by: mariner
5 Replies
Login or Register to Ask a Question