Re: Reading in files w/ Wordpad associations under NT [message #23506] |
Thu, 25 January 2001 10:07 |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
I have read files associated with Excel, Word, BBedit, Igor, SimpleText
and unknown into IDL. I have never had a problem with not being able to
read a file as long as its complete path and name are provided to the
file reading procedure. Can you give a short code example that fails?
Cheers,
Pavel
Dale Brewe wrote:
>
> I have a problem reading in ascii files under NT that have become associated
> w/ Wordpad or Notepad. For example, I have a data file named file.0001 that
> has become associated w/ Wordpad when someone opened the file to look at it w/
> Wordpad. Now, if I try to read ".0001" files w/ READ_ASCII in IDL, it fails
> for some reason. I assume I could unassociate this file extension from Wordpad
> somehow, but another user will most likely reassociate it again, so I would
> like to know if someone knows of a permanent solution that will allow me to
> get IDL to read in this file extension even w/ the association. Note that the
> code is in fact working for similar files that aren't associated w/ Wordpad or
> Notepad (i.e. file.0002, file.0003, etc)!
> Thanks
> Dale Brewe
|
|
|
Re: Reading in files w/ Wordpad associations under NT [message #23509 is a reply to message #23506] |
Thu, 25 January 2001 09:45  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Dale Brewe (brewe@pnc.aps.anl.gov) writes:
> I have a problem reading in ascii files under NT that have become associated
> w/ Wordpad or Notepad. For example, I have a data file named file.0001 that
> has become associated w/ Wordpad when someone opened the file to look at it w/
> Wordpad. Now, if I try to read ".0001" files w/ READ_ASCII in IDL, it fails
> for some reason. I assume I could unassociate this file extension from Wordpad
> somehow, but another user will most likely reassociate it again, so I would
> like to know if someone knows of a permanent solution that will allow me to
> get IDL to read in this file extension even w/ the association. Note that the
> code is in fact working for similar files that aren't associated w/ Wordpad or
> Notepad (i.e. file.0002, file.0003, etc)!
I don't think this problem has anything to do
with IDL. When the files get opened in Wordpad
or Notepad, they are probably being saved with
.txt extensions. (Microsoft to its great credit
and our eternal exasperation is always trying
to read our minds and be helpful.) You may not
be aware of this unless you are viewing your files
with their extensions turned on.
You will probably have to use some kind of string
processing function to check the file extensions
of your files and accommodate files with and
without .txt extensions. Or, train your users
to open the damn files from within the IDL
development environment. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|