HP3000-L Archives

January 2000, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Mark Bixby <[log in to unmask]>
Date:
Wed, 19 Jan 2000 11:53:34 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (27 lines)
"Leonard S. Berkowitz" wrote:
>
> I need to extract the last record of a file into a second file.
>
> I can use
>
> PURGE file2
> FILE file2;SAVE
> PRINT file1;OUT=*file2;UNN;START=-1
>
> or
>
> PURGE file2
> SETVAR EOF_FILE1 FINFO ("file1","EOF) - 1
> FCOPY FROM=file1;TO=file2;SUBSET=!EOF_FILE1,1;NEW
>
> I assume that behind the scenes PRINT is doing stuff implicitly that I have to
> do explicitly for FCOPY.
>
> Which method is faster or more efficient or better. Is there a better way?

The POSIX solution would be simply:

tail -1 file1 >file2

- Mark B.

ATOM RSS1 RSS2