Sponsored Content
Full Discussion: append question
Top Forums UNIX for Dummies Questions & Answers append question Post 302081172 by zazzybob on Sunday 23rd of July 2006 08:35:46 AM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
XZDIFF(1)							     XZ Utils								 XZDIFF(1)

NAME
xzcmp, xzdiff, lzcmp, lzdiff - compare compressed files SYNOPSIS
xzcmp [cmp_options] file1 [file2] xzdiff [diff_options] file1 [file2] lzcmp [cmp_options] file1 [file2] lzdiff [diff_options] file1 [file2] DESCRIPTION
xzcmp and xdiff invoke cmp(1) or diff(1) on files compressed with xz(1), lzma(1), gzip(1), or bzip2(1). All options specified are passed directly to cmp or diff. If only one file is specified, then the files compared are file1 (which must have a suffix of a supported com- pression format) and file1 from which the compression format suffix has been stripped. If two files are specified, then they are uncom- pressed if necessary and fed to cmp(1) or diff(1). The exit status from cmp or diff is preserved. The names lzcmp and lzdiff are provided for backward compatibility with LZMA Utils. SEE ALSO
cmp(1), diff(1), xz(1), gzip(1), bzip2(1), zdiff(1) BUGS
Messages from the cmp(1) or diff(1) programs refer to temporary filenames instead of those specified. Tukaani 2009-07-05 XZDIFF(1)
All times are GMT -4. The time now is 04:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy