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

Home » Public Forums » archive » Re: read multiple files with varying names
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: read multiple files with varying names [message #66639 is a reply to message #66601] Fri, 29 May 2009 09:39 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
sophie.hoss@gmail.com writes:

> David, that was also my first guess, so i took a look at the .dat-file
> (opened it in an editor) and it seems to me as if the last line was
> indeed empty (cursor can be placed into the last line which is empty).
> then I did the conditioning, but it says there is no "empty" lines
> (count =3D 0).
> however, i think i made it work now - at least that's what my tired
> brain thinks.
> I'll take a closer look into this after the weekend.
> bye everybody

Even more pernicious, sometimes those empty lines will have
space characters on them. Aaauuuggghhh! Try doing a string
compress on the string array before checking for empty
strings.

file = 'datafile.dat'
rows = File_Lines(file)
data = StrArr(rows OpenR, lun, file, /Get_Lun
ReadF, lun, data
Free_lun, lun
data = StrCompress(data, /REMOVE_ALL)
I = Where( data EQ "", count)
IF count GT 0 THEN Print, "I got trouble!!"

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Am I having a blackout?
Next Topic: How to extract latitude and longitude information from HDF file?

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

Current Time: Wed Oct 08 19:26:05 PDT 2025

Total time taken to generate the page: 0.00374 seconds