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

Home » Public Forums » archive » operating on tab-/comma-delimited files
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: operating on tab-/comma-delimited files [message #85699 is a reply to message #85698] Wed, 28 August 2013 10:11 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Seb writes:

>
> Hi,
>
> I am in the process of updating code I've inherited as I learn IDL, and
> noticed that it uses the following workflow for fixing errors in
> tab-/comma-delimited files:
>
> 1. Use file_search to generate a list of files to work on
>
> 2. Use FOR loop to iterate through each file
>
> 2.1 Create a float array with the same dimensions as input file
> 2.2 Load the data into a string array with 'openr' -> 'strarr' ->
> 'readf' -> 'close'
> 2.3 Loop through each line doing various tests/operations
> 2.4 Copy the fixed data into the float array in 2.1
>
> 3. Write the float array with 'openw' -> 'printf' -> 'close'
>
> Based on what I'm reading, it seems this should be more efficient by
> using 'read_ascii' and then fixing the errors with array indexing and
> then writing the data back. Is this worth pursuing, or are there any
> recommendations for a module I should know about?

Normally you step through as file like this reading a line at a time if
the problems with the file are more difficult to deal with than the
simple problems READ_ASCII can handle. We can't say without seeing the
file itself.

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: delete all windows at once
Next Topic: What subprogram? What parameters and keywords?

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

Current Time: Fri Oct 10 05:29:31 PDT 2025

Total time taken to generate the page: 0.00743 seconds