Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to paste second file into the first file Post 302714259 by guruprasadpr on Friday 12th of October 2012 02:29:18 AM
Old 10-12-2012
Why not just:
Code:
paste file1 file2

Guru.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Paste content of a file to another file and make it as columned

Pls help me on this. I have to 2 files like shown below: File 1 TAIJM AXPKIM BEMGW File 2 PXMPA JYGE IMJP What i want to do is to paste both file to a new file on thir format: File 3 TAIJM PXMPA AXPKIM JYGE BEMGW IMJP I tried cat and print, but it doesn't work. Cn... (6 Replies)
Discussion started by: kingpeejay
6 Replies

2. UNIX for Dummies Questions & Answers

Cut paste from one file to other

Hello, I am working on unix for the first time. I have to write a shell script where i want to cut paste from one file to other. File "1234.abc" is 03,12345555 16,936,x,x,120 16,936,x,x,100 49,12345555 03,12347710 16,936,x,x,115 16,936,x,x,122 49,12347710 03,12342222... (9 Replies)
Discussion started by: swapsb
9 Replies

3. Shell Programming and Scripting

Paste second columns from files to its corresponding file

Hi All, I have two sets of files. One set with extension .txt This set has file names with numbers like these. 1.txt, 2.txt, 3.txt until extactly 100.txt. The .txt files look like these: 0.38701788 93750 0.38622013 94456 0.38350296 94440 0.38282126 94057 0.38282126 94439 0.35847232... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

4. Shell Programming and Scripting

awk read value from file and paste in other file

Hi, I'm working on a perl-awk loop combination and what I want to do is read in the first line of values.exp and pass that value to test1.exp; next, read in the second line of that file and pass that value to test2.exp. Which would mean: values.exp: 1.2 1.4 test1.exp 1 test2.exp... (10 Replies)
Discussion started by: tobias1234
10 Replies

5. Shell Programming and Scripting

How do you paste >> into a file in a terminal?

how do you paste >> into a file in a terminal? it keeps pasting as <<EOF EOF i just want it to show << i have a list of mysql commands in a text file and i want to paste it into another file which i'm using the terminal to edit thanks! (4 Replies)
Discussion started by: vanessafan99
4 Replies

6. Shell Programming and Scripting

Help required the cut the whole contents from one file and paste it into new file

Hi, First of all sincere apologies if I have posted in a wrong section ! Please correct me if I am wrong ! I am very new to UNIX scripting. Currently my problem is that I have a code file at the location /home/usr/workarea/GeneratedLogs.log :- Code :- (Feb 7, 571 7:07:29 AM),... (4 Replies)
Discussion started by: acidburn_007
4 Replies

7. OS X (Apple)

Paste text into vi file?

Hello, I'm running OS X 10.7.4. How can I paste text from the pasteboard into an open vim file? Thanks! (21 Replies)
Discussion started by: palex
21 Replies

8. Shell Programming and Scripting

Use of the PASTE command in a script file

Hi, When I use the paste command in the terminal window it works fine, but when i try to use it in a bash script file i get errors. I'm not sure how to use the paste command in a bash script file. my paste command looks like this paste <( code1 ) <(code2) thanks (7 Replies)
Discussion started by: eboye
7 Replies

9. Shell Programming and Scripting

How to cut a pipe delimited file and paste it with another file to form a comma separated outputfile

Hello ppl I have a requirement to split (cut in unix) a file (A.txt) which is a pipe delimited file into A1.txt and A2.txt Now I have to join (paste in unix) this A2.txt with external file A3.txt to form output file A4.txt which should be CSV (comma separated file) so that third party can... (25 Replies)
Discussion started by: etldev
25 Replies

10. Shell Programming and Scripting

Create and paste two file into one

Hello i want to create this list: 2a05:b80:0:235::9f/1159 2a05:b80:0:235::a0/1160 2a05:b80:0:235::a1/1161 2a05:b80:0:235::a2/1162 2a05:b80:0:235::a3/1163 so write this shell as well: #Global VAR STR=159 END=200 #INI NET IPV6 PART SUM1=`expr $END - $STR` for ((i=STR;i<=END;++i)); do... (6 Replies)
Discussion started by: nimafire
6 Replies
paste(1)						      General Commands Manual							  paste(1)

NAME
paste - Joins corresponding lines of several files or subsequent lines in one file SYNOPSIS
paste [-d list] [-s] file... STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: paste: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
Replaces the delimiter that separates lines in the output (tab by default) with one or more characters from list. If list contains more than one character, then the characters are repeated in order until the end of the output. In parallel merging, the lines from the last file always end with a newline character, instead of one from list. The following special characters can be used in list: Newline character Tab Backslash Empty string (not a null character) [Tru64 UNIX] An extended character You must quote characters that have special meaning to the shell. Merges all lines from each input file into one line of output (serial merging). Using this option, the paste command merges all lines in the first input file forcing a newline before at the end. The command then continues with the next input file, continuing in the same manner until all input files have been completed. A tab separates the input lines unless you use the -d option. Regardless of the list, the last character of the output is a newline character. OPERANDS
The name of an input file. You may specify up to 12 files, including hyphens. If you specify a -, paste reads standard input recursively, one line for each -. DESCRIPTION
Specifying the -d option or no options causes the paste command to treat each file as a column, joining them horizontally with a tab char- acter by default (parallel merging). Using the -s option, the paste command combines all lines of each input file into one output line (serial merging). These lines are joined with the tab character by default. Output lines can be any length. [Tru64 UNIX] The output of pr -t -m is similar to the output produced by the paste command, but pr with its options creates extra spaces, tabs, and lines for an enhanced page layout. RESTRICTIONS
If the -s option is not used, it is an error if any specified file cannot be opened. EXIT STATUS
The following exit values are returned: Successful completion. An error occurred. EXAMPLES
To paste several columns of data together, enter: paste names places dates > npd This creates a file named npd that contains the data from names in one column, places in another, and dates in a third. The columns are separated by tab characters. File npd then contains: rachel New York 28 February jerzy Warsaw 27 April mata Nairobi 21 June michel Boca Raton 27 July segui Managua 18 November A tab character separates the name, place, and date on each line. To separate the columns with a character other than a tab (sh only), enter: paste -d"!@" names places dates > npd This alternates the apostrophe (!) and the at sign (@) as the column separators. If names, places, and dates are the same as in Example 1, then npd contains: rachel!New York@28 February jerzy!Warsaw@27 April mata!Nairobi@21 June michel!Boca Raton@27 July segui!Managua@18 November To dis- play the standard input in multiple columns, enter: ls | paste - - - - This lists the current directory in four columns. Each hyphen (-) tells the paste command to create a column containing data read from the standard input. The first line is put in the first column, the second line in the second column, ... and then the fifth line in the first column, and so on. This is equivalent to ls | paste -d" " -s - which fills the columns across the page with subsequent lines from the standard input. The -d defines the character to insert after each column: a tab character ( ) after the first three columns, and a newline character ( ) after the fourth. Without the -d option, paste -s - displays all of the input as one line with a tab between each column. To merge the lines of the file names above into one output line, enter: paste -s names This results in: rachel jerzy mata michel segui ENVIRONMENT VARIABLES
The following environment variables affect the execution of paste: Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari- ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments and input files). Determines the locale for the format and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. SEE ALSO
Commands: cut(1), grep(1), fold(1), join(1), pr(1) Standards: standards(5) paste(1)
All times are GMT -4. The time now is 05:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy