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 
Return to the default flat view Create a new topic Submit Reply
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 messageGo 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
[Message index]
 
Read Message
Read Message
Read Message
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: Sat Oct 18 22:18:08 PDT 2025

Total time taken to generate the page: 2.48067 seconds