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

Home » Public Forums » archive » Reading ASCII
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Reading ASCII [message #4706] Fri, 21 July 1995 00:00 Go to previous message
dean is currently offline  dean
Messages: 55
Registered: March 1993
Member
I am attempting to read a ASCII text file with topography data.
This file was created on a DOS machine and has a CR and NL character
after each line. In my attempts to read this file, I keep getting
the CR and NL characters which messes up my image. Is there a
way to read this file without picking up the CR and NL with IDL?

Below is the sample PRO I am working with. The ASCII file
is located on castor.cira.colostate.edu in Dean.

Kelly Dean
CSU/CIRA


============================================================ ====

PRO READ_TOP
imgname = 'elev.txt'
xsize = 961
ysize = 601

openr, unit, imgname, /get_lun
status = FStat(unit)
HELP, status, /STRUCT
image = INTarr(xsize, ysize)
scan = INTarr(xsize)
FOR j = 0, ysize-1 DO BEGIN
readU, unit, scan
image(0,(ysize-1)-j) = scan
ENDFOR
close, unit
free_lun, unit
nmax = MAX(image)
nmin = MIN(image)
print, ' MAX ',nmax,' Min ',nmin
WINDOW, 0, xsize=xsize,ysize=ysize,title='Elevation'
TVscl, image

end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Question about MOMENT
Next Topic: Program code area exceeded?? 50k file

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

Current Time: Wed Oct 08 18:03:54 PDT 2025

Total time taken to generate the page: 0.00452 seconds