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 #85700 is a reply to message #85698] Wed, 28 August 2013 10:21 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
I'd say the code is already efficient in that it reads and writes each file with a single I/O operation. Any place for improvement would be in step 2.3.

On Wednesday, August 28, 2013 12:56:27 PM UTC-4, Seb wrote:
> 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?
>
>
>
> Thanks,
>
>
>
> --
>
> Seb
[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 Nov 28 12:18:24 PST 2025

Total time taken to generate the page: 0.00231 seconds