Re: How can I read data file with tab delimeter? [message #5553 is a reply to message #5548] |
Thu, 11 January 1996 00:00  |
M.W.Gardner
Messages: 7 Registered: November 1995
|
Junior Member |
|
|
ashi@acacia.lle.rochester.edu (Alexei Chirokikh) wrote:
> Hi,
> I have column organized data with TAB - delimeter. How can I read this data?
>
Assuming your data is organised in a consistent manner (i.e. all rows and
columns contain the same number of data points) then thus is really easy..
Assume your file is organised with 5 columns and 4 rows and contains floating
point data.
The IDL code to read this into the array my_data is as follows
my_data=fltarr(5,4) ;define array of correct dimensions and type
openr,lun,'my_tab_file.dat',/get_lun ;open file
readf,lun,my_data ;read data into array maintaining structure in file
close,lun ;close file
free_lun,lun ;free logical file unit
IDL can reads tabs as multiple space delimiters - you do not have to specify
the fact that the delimiter is a tab.
Hope that helps - if not get in touch.
Matt
--
-----> Matt Gardner EMAIL->m.W.gardner@uea.ac.uk PHONE->+44- 1603-592041
School of Environmental Science,University of East Anglia,Norwich,NR4 7TJ,UK
------------------------------------------------------------ ------------------
opinions are mine - http://www.uea.ac.uk/~e449
|
|
|