append question


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers append question
# 1  
Old 07-19-2006
append question

I have a .pl script that is grabbing information and creating two different .txt files, I need to append one to the other.


Code:
     open GARPFILE;
     open GARPFILEXX;
     cat $gGarpFileXx >> $gGarpFile;
  
     close GARPFILE;
     close GARPFILEXX;

but I'm getting this:
Useless use of right bitshift (>>) in void context at ./xx_garp_test.pl line 296.

I know this should be simple but it's driving me crazy!
Can anyone help me out?
Thanks in advance
# 2  
Old 07-23-2006
I'd do something like this, there is probably a simpler way of doing it.

Code:
$ cat ./append.pl
#! /usr/bin/perl

my $file1;
my $file2;

$file1 = "./file1";
$file2 = "./file2";

open( FILE1, "< $file1" );
open( FILE2, ">> $file2" );
while ( <FILE1> ) {
  print FILE2 $_;
}
close( FILE1 );
close( FILE2 );

Cheers
ZB
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find and Append

I'm not sure this is the *best* idea but it's what occurs to me: I have a long bibliographical list where the entries are in a variety of forms. So, there's no consistent format. I can pretty much find the year of publication buried in each line. Everything else is a bit of a mess. So, human... (5 Replies)
Discussion started by: fred3
5 Replies

2. UNIX for Advanced & Expert Users

Append in one line

Hello, I have a very huge file having below data:- subsD,00 05 02 70 DB 3D 4A B8 47 5B 38 00,919030055007,,22, ,,,,23, ,,,,21, subsD,00 05 02 FD DE 3D 4A B8 47 5D 38 00,919030055007,,23, ,,,,47, ,,,,49, subsD,00 05 02 BA 01 3E 4A B8 47 67 38 00,919030055007,,22, ,,,,23, ,,,,21,... (5 Replies)
Discussion started by: Sanket11
5 Replies

3. Shell Programming and Scripting

question about append columns

I like to do the following, please help! Thanks a lot for f in seq(f1 f2 f3 g1 h1 t2) do cut -d "+" -f2 $f > $f.nums paste ? # each loop will attach additional column to the created file $f.nums, how to do this??? done (1 Reply)
Discussion started by: ksgreen
1 Replies

4. Shell Programming and Scripting

Need to append at end

I have the following input axrsgpar0335 METTEST DPC OUTLN OPEN Y axrsgpar0335 METTEST DPC SYS ... (4 Replies)
Discussion started by: ilugopal
4 Replies

5. Shell Programming and Scripting

append the position 28:33

I have a file FILE1.DAT like below 21111111110001343 000001004OLF-AA029100020091112 21111111110000060 000001004ODL-CH001000020091112 24444444440001416 000001045OLF-AA011800020091112 23333333330001695 000001039OLF-AA030600020091112 23333333330000111 000001039ODL-SP002000020091112... (2 Replies)
Discussion started by: new2ksh
2 Replies

6. Shell Programming and Scripting

How to append to the file?

Hi I have the file contents as below...... MNG={{ABC|fdb|222}=12.0|1.3|1.5} MNG={{DEF|dfg|333}=11.0|0|0} MNG={{FGH|fcv|444}=4.0|7.0|1.5} I need to search for the particular id '333' in the file and append to the end of the particular row with the value 1.6. Can any one help me to... (9 Replies)
Discussion started by: vinay123
9 Replies

7. Shell Programming and Scripting

append a ' to the $1 $2

Hi all , Iam trying to append a ' to the end of the $1 and $2 in the bellow example : awk '{print "exec upload" ,$1,$2,$3 "\ngo"}' so the output would be something like this : exec upload '444042 ','444042 ','919841037265' i am getting : exec upload 444042 ,444042 ,919841037265 ... (2 Replies)
Discussion started by: ppass
2 Replies

8. UNIX and Linux Applications

ftp append question

Quick question. Will append act like 'put' if the file I'm telling it to append to doesn't exist? (2 Replies)
Discussion started by: Lindarella
2 Replies

9. Shell Programming and Scripting

perl: simple question on string append

I want to append a decimal number to a string. But I want to restrict the number to only 2 decimal points for e.g: my $output = "\n The number is = "; my $number = 2.3333333; $output = $output . $number; But I want the $output as: "The number is = 2.33"; and not 2.3333333 (I do not... (1 Reply)
Discussion started by: the_learner
1 Replies

10. Shell Programming and Scripting

Append with TM symbol

I have a file with delimiter ";" and 2 columns for eg: Transparent; ScotchPro™ If you see carefully you can see a special character "TM" at the end of data which is not showing up when I read the data in a regular sequential file. Did anyone anytime tackle this kind of Data. Please advice.... (1 Reply)
Discussion started by: ganesh123
1 Replies
Login or Register to Ask a Question