06-21-2010
Inserting a file in another file
I wish to insert all the lines of b.txt in certain places(more than one place) of another file a.txt. Can anyone help? I'd prefer a short script(perl/shell)
Thanks
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
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
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
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
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
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
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
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
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
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
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