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

Home » Public Forums » archive » Reading data, without column header
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Reading data, without column header [message #79950] Tue, 10 April 2012 22:33
shambhu is currently offline  shambhu
Messages: 41
Registered: December 2011
Member
Hi

I have a .dat file, which contains 5 columns. I want to read data of
the file in to other file for manipulation. I want to read it from
second row. Please tell me how to do.


I am using following code, but when i run first time it shows error
coz of type mis-match. When i continue with execution it works. Please
help mr to avoid his error.

data = fltarr(5)
filename = '/scratch/shambhu/cdays.dat'
openr,lun,filename,/get_lun
rows=file_lines(file)

for j=0, rows-1 do begin
readf, lun, data
t = data(0)
q = data(1)
Md = data(2)
h = data(3)
hplus = data(4)
endfor
free_lun, lun


Output:
IDL> readf, lun, data
% READF: Input conversion error. Unit: 100
File: /scratch/shambhu/cdays.dat
% Execution halted at: $MAIN$
IDL> readf, lun, data
IDL> print,data[0]
289.021
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: interpolation of angular data (interpolation in a circle)
Next Topic: Re: Reading data, without column header

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

Current Time: Wed Oct 08 09:13:21 PDT 2025

Total time taken to generate the page: 0.00530 seconds