Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to paste second file into the first file Post 302714265 by narachaid on Friday 12th of October 2012 02:36:29 AM
Old 10-12-2012
Hello, Thank you for the responses.

I tried both of the codes and it gives me this:
(I am showing you a single line, just a very long sequence. File 1 is shown in blue and file 2 is shown in red)

June2012 57 928824 TACATCCGTAATATACATATATATATATATATATATATATATATGTATGAGTCGTGGAAGAACCAAATCATATTCACCACTACAGCACGTCGTAGCTAGT ATAGAATAAAGAGCTCAAAGAAAAAGGAACGTTATATATATGATCAGATTTCATGCTTATGTTCTACATATTATGGTTTTTCTATACTGACATTAACTGT ATTATACTATATATATTACACCGTGTTCACPos(+)CGGCCAGAATTAAGAAAC

I don't understand why the file 2 pasted in the middle of file 1, instead of separated by a tab after the very last column of file 1.
 

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)							   User Commands							  paste(1)

NAME
paste - merge corresponding or subsequent lines of files SYNOPSIS
paste [-s] [-d list] file... DESCRIPTION
The paste utility will concatenate the corresponding lines of the given input files, and write the resulting lines to standard output. The default operation of paste will concatenate the corresponding lines of the input files. The NEWLINE character of every line except the line from the last input file will be replaced with a TAB character. If an EOF (end-of-file) condition is detected on one or more input files, but not all input files, paste will behave as though empty lines were read from the files on which EOF was detected, unless the -s option is specified. OPTIONS
The following options are supported: -d list Unless a backslash character () appears in list, each character in list is an element specifying a delimiter character. If a backslash character appears in list, the backslash character and one or more characters following it are an element specifying a delimiter character as described below. These elements specify one or more delimiters to use, instead of the default TAB charac- ter, to replace the NEWLINE character of the input lines. The elements in list are used circularly. That is, when the list is exhausted, the first element from the list is reused. When the -s option is specified: o The last newline character in a file will not be modified. o The delimiter will be reset to the first element of list after each file operand is processed. When the option is not specified: o The NEWLINE characters in the file specified by the last file will not be modified. o The delimiter will be reset to the first element of list each time a line is processed from each file. If a backslash character appears in list, it and the character following it will be used to represent the following delimiter characters: Newline character. Tab character. \ Backslash character. Empty string (not a null character). If is immediately followed by the character x, the character X, or any character defined by the LC_CTYPE digit keyword, the results are unspecified. If any other characters follow the backslash, the results are unspecified. -s Concatenate all of the lines of each separate input file in command line order. The NEWLINE character of every line except the last line in each input file will be replaced with the TAB character, unless otherwise specified by the -d option. OPERANDS
The following operand is supported: file A path name of an input file. If - is specified for one or more of the files, the standard input will be used. The standard input will be read one line at a time, circularly, for each instance of -. Implementations support pasting of at least 12 file operands. USAGE
See largefile(5) for the description of the behavior of paste when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). EXAMPLES
Example 1: Listing a directory in one column example% ls | paste -d" " - Example 2: Listing a directory in four columns example% ls | paste - - - - Example 3: Combining pairs of lines from a file into single lines example% paste -s -d" t n" file ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of paste: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWesu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
cut(1), grep(1), pr(1), attributes(5), environ(5), largefile(5), standards(5) DIAGNOSTICS
"line too long" Output lines are restricted to 511 characters. "too many files" Except for -s option, no more than 12 input files may be specified. "no delimiters" The -d option was specified with an empty list. "cannot open file" The specified file cannot be opened. SunOS 5.10 20 Dec 1996 paste(1)
All times are GMT -4. The time now is 03:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy