Sponsored Content
Top Forums Shell Programming and Scripting inserting a file into another file Post 21235 by Bashar on Tuesday 14th of May 2002 12:01:53 AM
Old 05-14-2002
inserting a file into another file

Hello, i have 2 files with the same number of lines and i want to have the first file entries to be inserted into the 2nd file lines but infront of them , i.e
file1:
myname
hisname
hername

file2:
=fine
=mine
=pine

the output file should be like this:

output:
myname=fine
hisname=mine
hername=pine

and so on , is it possible to do it with simple script?
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Inserting a new column in a file

Hey.. I'm writing a code to download some stuff from Informix database and put it on Xls. It works fine, but I have a problem fitting in a new requirement. I have currently a file which has information like below. f_name|Ronnie|Johnson|23.00| f_sal|Ronnie|Jhonson|4000.00|... (4 Replies)
Discussion started by: rosh0623
4 Replies

2. Shell Programming and Scripting

Inserting file into another file at a specified line number

Hi, I have two files XXX.dat and YYY.dat and their contents are as follows. The contents of XXX.dat(The line numbers are just for reference) 1) Mango 2) Banana 3) Papaya 4) Apple 5) Pomegranate The contents of YYY.dat 1) Custard apple 2) Grape 3) ... (4 Replies)
Discussion started by: Rajendra_1510
4 Replies

3. Shell Programming and Scripting

Inserting a file into another file above a specified location

Hi.I have two files say XXX.dat and YYY.dat The contents of XXX.dat and YYY.dat are as follows XXX.dat Jan Feb Mar Apr Method 1 { echo "This is method 1" } YYY.dat Delhi Culcutta One (4 Replies)
Discussion started by: Rajendra_1510
4 Replies

4. Shell Programming and Scripting

Inserting a column from one file into another big file

Hi I have two files, one is 1.6 GB. I would like to add one extra column of information to the large file at a specific location (after its 2nd column). For example: File 1 has two columns more than 1000 rows like this MM009987 1 File 2 looks like this MM00098 MM00076 3 4 2 4 2... (1 Reply)
Discussion started by: sogi
1 Replies

5. Shell Programming and Scripting

gawk help for inserting a field of a .txt file in the same file

i had the following type of data file vchrdump: Vouchers For Date :05/01/2009 * ... (4 Replies)
Discussion started by: KANNI786
4 Replies

6. UNIX for Dummies Questions & Answers

Best method for inserting a field from a file into another file?

Hello, Hoping someone can help! I have a file (fileA) with a potentially different number of | delimited fields the file looks like: fileA A|B|C|D|E|F|G| A|B|C|D|E|F|G| This file could have 100+ fields and have 2million+ records I have another file (fileB) which contains an 8 digit... (3 Replies)
Discussion started by: dendright
3 Replies

7. Shell Programming and Scripting

Inserting file after specific line in another file

Im attempting to insert the contents of File1 at a specific point of File2. File1 AD004 0 1 0 0 1 0 1 0 0 1 0 1 0 1 0 1 File2 AA001 0 1 0 0 1 0 1 0 0 1 0 1 0 1 0 1 AB002 0 1 0 0 1 0 1 0 0 1 0 1 0 1 0 1 AC003 0 1 0 0 1 0 1 0 0 1 0 1 0 1 0 1 Result AA001 0 1 0 0 1 0 1 0 0 1 0 1 0 1 0 1... (13 Replies)
Discussion started by: ncwxpanther
13 Replies

8. Shell Programming and Scripting

Inserting data - from one file to another?

Hi Experts, I have a config file (file1) & a data file (file2) : - The file1 I want to modify : to replace "2nd fields c7? & m7? from the data from file2, -The below CPU line fields need to fill by file2's 1st colmns correspoding data. - The below MEM lines to be replaced by... (3 Replies)
Discussion started by: rveri
3 Replies

9. Shell Programming and Scripting

Inserting Header to another file

Need your help in appending header(file1 contains header ) to my file2. I am using KSH AIX OS. I know how to do with taking temporary files. cat file1 >temp cat file2 >>temp mv temp file2 Is there way to append directly to a file in ksh. I don't find Sed -i option on my... (10 Replies)
Discussion started by: gvkumar25
10 Replies

10. Shell Programming and Scripting

Inserting IDs from a text file into a sequence alignment file

Hi, I have one file with one column and several hundred entries File1: NA1 NA2 NA3And now I need to run a command within a mapping aligner tool to insert these sample names into a sequence alignment file (SAM) such that they look like this @RG ID:Library1 SM:NA1 PL:Illumina ... (7 Replies)
Discussion started by: nans
7 Replies
COMM(1) 						    BSD General Commands Manual 						   COMM(1)

NAME
comm -- select or reject lines common to two files SYNOPSIS
comm [-123i] file1 file2 DESCRIPTION
The comm utility reads file1 and file2, which should be sorted lexically, and produces three text columns as output: lines only in file1; lines only in file2; and lines in both files. The filename ``-'' means the standard input. The following options are available: -1 Suppress printing of column 1. -2 Suppress printing of column 2. -3 Suppress printing of column 3. -i Case insensitive comparison of lines. Each column will have a number of tab characters prepended to it equal to the number of lower numbered columns that are being printed. For example, if column number two is being suppressed, lines printed in column number one will not have any tabs preceding them, and lines printed in column number three will have one. The comm utility assumes that the files are lexically sorted; all characters participate in line comparisons. DIAGNOSTICS
The comm utility exits 0 on success, and >0 if an error occurs. SEE ALSO
cmp(1), diff(1), sort(1), uniq(1) STANDARDS
The comm utility conforms to IEEE Std 1003.2-1992 (``POSIX.2''). HISTORY
A comm command appeared in Version 4 AT&T UNIX. BSD
June 6, 1993 BSD
All times are GMT -4. The time now is 03:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy