develooper Front page | perl.beginners | Postings from January 2002

Re: How to abut two files?

Thread Previous
From:
Roger Morris
Date:
January 30, 2002 16:09
Subject:
Re: How to abut two files?
Message ID:
4.2.0.58.20020130160740.027b5ed8@eug4ja.lane.edu
At 06:18 PM 1/30/2002 -0500, you wrote:
>One of the most common needs in data analysis is to "abut" two files.  This
>means to create a single file by horizontally pasting two files together.
>
>So: starting with two files each with, say, 4 columns and 4 rows, the result
>is one file with 8 columns and 4 rows.
>
>For a couple decades now I've relied on Gary Perlman's "stat" utilities
>(specfically, the abut program) to do this in a unix environment.
>
>How to do it on a macintosh?  I'd like to avoid having to use a program like
>microsoft excel.  I'm wondering if perl has the ability to abut two files.
>I've downloaded perl, but before trying to master it, I'm hoping someone
>knowledgeable would be willing to tell me if (and how) perl can easily abut
>two files.

Essentially, you would go through both files a line at a time printing to a 
third file.
first reading the first file, print, read second file, print etc. for each 
line.

Which Mac OS do you have?  X should have perl by default.

Roger

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About