Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15667

Re: Read last expression in a file?

From Heike Gramberg <heike.gramberg@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Read last expression in a file?
Date 2011-01-31 08:23 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <ii5rh6$ff3$1@smc.vnet.net> (permalink)

Show all headers | View raw


If you are working on unix/linux/os x and your output file contains one expression per line, you could use something like

ReadList["!tail outputfile", Expression]

where outputfile is the name of your output file. This basically calls the external command tail which is a program on unix/linux that displays the last few lines of a file.

I'm not familiar with windows so I don't what the windows equivalent of tail would be.

Heike.

On 30 Jan 2011, at 00:43, Ramiro wrote:

> Hello,
>
> I wrote a program that generates a lot of Mathematica output.
>
> Now I need to restart it using the very last expression of such output
> as the new input.   However, I can't find a way to only read the last
> expression in a file, something like a Read that would start at the
> end.  It would be too time consuming and perhaps not enough memory in
> my computer to read the entire file.
>
> Any suggestions?
>
> Thanks,
> Ramiro
>

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: Read last expression in a file? Heike Gramberg <heike.gramberg@gmail.com> - 2011-01-31 08:23 +0000
  Re: Read last expression in a file? Chris Degnen <degnen@cwgsy.net> - 2011-02-02 11:14 +0000
    Re: Read last expression in a file? Chris Degnen <degnen@cwgsy.net> - 2011-02-02 12:03 +0000
      Re: Read last expression in a file? Albert Retey <awnl@gmx-topmail.de> - 2011-02-03 10:29 +0000

csiph-web