Computing.Net > Forums > Unix > merge 2 files using perl

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

merge 2 files using perl

Reply to Message Icon

Name: gounix
Date: June 4, 2007 at 00:47:26 Pacific
OS: SunOS
CPU/Ram: xx
Product: xx
Comment:

Hi Could anybody give me way out in perl
to create a target file from two source files as given below

file1
line1..
line2..

file2
line1..
line2...

expected output file should be
line1 of file1 line1 of file2
line2 of file1 line2 of file2
...
..

Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: June 4, 2007 at 07:03:23 Pacific
Reply:

Unless you are doing homework, you don't need perl for this problem. Use the paste command:

paste file1 file2 > outputfile



0

Response Number 2
Name: gounix
Date: June 8, 2007 at 00:14:46 Pacific
Reply:

Thanks nails.

I know this option.

But paste is having limitation (atleast in my SunOS) that it can read aournd 500 characters.
I have a file containing 15000 characters long lines in it

pass out comments if any



0

Response Number 3
Name: gounix
Date: June 8, 2007 at 00:15:51 Pacific
Reply:


refresh


0

Response Number 4
Name: gounix
Date: June 8, 2007 at 00:17:01 Pacific
Reply:

refresh r



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: merge 2 files using perl

help: parsing html file using perl www.computing.net/answers/unix/help-parsing-html-file-using-perl-/7851.html

trouble merging two files with awk www.computing.net/answers/unix/trouble-merging-two-files-with-awk/7937.html

Merging 2 lines www.computing.net/answers/unix/merging-2-lines/5084.html