help-octave
[Top][All Lists]
Advanced

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

Re: reading a TAB-separated file


From: David Bateman
Subject: Re: reading a TAB-separated file
Date: Sat, 16 Sep 2006 14:34:57 +0200
User-agent: Thunderbird 1.5.0.5 (X11/20060817)

I don't think its easy to do what you want with the 2.1.x octave-forge
regexp. However I believe that you can parse the entire file with a
single regexp in 2.9.x with following

fid = fopen("myfile");
str = char(fread(fid)');
fclose(fid);
d = regexp(str,'^\s*([^\s\t]+)\s*\t+\s*([^\s\t]+).*$',  ...
'tokens','dotexceptnewline','lineanchors')

Which is in fact also matlab compatible.

Regards
David


reply via email to

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