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

Home » Public Forums » archive » Writing a lot of data to ASCII file without a loop?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Writing a lot of data to ASCII file without a loop? [message #76866] Tue, 12 July 2011 03:11
rjp23 is currently offline  rjp23
Messages: 97
Registered: June 2010
Member
I need to write a large array of values to an ASCII file in two long
columns and wondered if there was a quick way of doing it.

Currently we do:

FOR i = 0, n_elements(s1)-1 DO BEGIN
printf, unit, s1[i], n1[i], format = '(1x,G15.9,1x,G15.9)'
ENDFOR

It works and is quick (0.06 seconds per file) but during our
processing we're creating tens of thousands of these files and the
time adds up.

Unfortunately we can't change the code that these are required as
input into (otherwise we'd write them all to a single HDF file for
example).

Is there a way to get rid of that loop?

Cheers

Rob
[Message index]
 
Read Message
Previous Topic: "feature" in NCDF_VARPUT
Next Topic: Re: Writing a lot of data to ASCII file without a loop?

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

Current Time: Wed Oct 08 16:16:46 PDT 2025

Total time taken to generate the page: 0.00184 seconds