help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: openning ascii file with headers that don't have special characters


From: Ron.Simonson
Subject: Re: openning ascii file with headers that don't have special characters (#) in front of them
Date: Tue, 4 Sep 2012 12:50:57 -0700
User-agent: Thunderbird 2.0.0.24 (X11/20100228)

kevinl wrote:
Hi,

I am trying to load an ascii file that look like :

# Some text
12   0.0E+00
 20  35 -131.658 -121.667   57.333   65.825 0.5000 0.2500

   time(years)=           0.0
   775.545
   761.773
   480.000
   247.591
  1295.091
   401.318

I would like to open that file startting at line 5.
I don't know if load can be used with a specific starting line. I tried dlmread :
dlmread('hypsN10.dir/hbhypsNHYPSGRID10.dat',' ',5,3);
but it doesn't work as some data start after 3 spaces and other after 2
spaces.

Thanks

How about putting sed -i '1,5 s/^/# /' filename in a system call before
you use load("filename") to comment the first five lines.  If you need
to you can use a similar sed call to remove the comment characters?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]