comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: writing ascii files (with really long lines...)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: writing ascii files (with really long lines...) [message #34272] Mon, 03 March 2003 10:02
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
"Craig Markwardt" wrote...

> I think there is some internal limit to the number of characters
> possible to output in a single call to PRINT.

Yes, there is a limit. I never took the time to determine the exact number
but it is somewhere around 12500 characters. I know that 12450 works.

-Rick
Re: writing ascii files (with really long lines...) [message #34296 is a reply to message #34272] Sat, 01 March 2003 07:11 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
CelticBlues (idluser@celticblues.com) writes:

> I have an image which I need to dump to an ascii file.... yes, it has to be
> ascii. Before any suggestions concerning an alternate output format are
> made, let me say that I am stuck with this format. But I wish it were other
> wise. The images are 148 rows x 1092 columns and what I output will be
> floating point values.
>
> I know that the program that will read this text file, expects to be able to
> read an entire row, and only one row, of the data, at a time. It uses MFCs
> CStdioFile::ReadString to read one line at a time then does a sscanf on it
> to get the data out of the string. I can't change how this code reads the
> file in either.....
>
> My question is ... can I do this and if so ...how? I have tried various
> methods, but each seems to wrap the line.

Something like this ought to work:

OpenW, lun, 'mydata.dat', /Get_Lun, Width=1092*10
FOR j=0,147 DO Printf, lun, image[*,j], Format='(1092F9.2)'
Free_Lun, lun

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: writing ascii files (with really long lines...) [message #34302 is a reply to message #34296] Fri, 28 February 2003 18:24 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"CelticBlues" <idluser@celticblues.com> writes:
> I have an image which I need to dump to an ascii file.... yes, it has to be
> ascii. Before any suggestions concerning an alternate output format are
> made, let me say that I am stuck with this format. But I wish it were other
> wise. The images are 148 rows x 1092 columns and what I output will be
> floating point values.
>
> I know that the program that will read this text file, expects to be able to
> read an entire row, and only one row, of the data, at a time. It uses MFCs
> CStdioFile::ReadString to read one line at a time then does a sscanf on it
> to get the data out of the string. I can't change how this code reads the
> file in either.....
>
> My question is ... can I do this and if so ...how? I have tried various
> methods, but each seems to wrap the line.

If your question is, how to prevent wrapping, then you probably want
to use an IDL format code to specify exactly the format you need.
With FORMAT, gratuitous carriage returns should not be inserted.

I think there is some internal limit to the number of characters
possible to output in a single call to PRINT. In that case, you may
need to print each row with several calls to PRINT. The '$' format
code should do the trick there.

Good luck,
Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: no backwards compatibility in IDL 5.6
Next Topic: Re: set_plot,'PS' and accurate colors?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 07:31:41 PDT 2025

Total time taken to generate the page: 1.67964 seconds