Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
Vijay
Posts:
91
Registered:
8/31/11
|
|
Re: help reading from a text file
Posted:
Jul 26, 2012 4:44 AM
|
|
TideMan <mulgor@gmail.com> wrote in message <5ae10137-5aaf-441e-8c49-4a6cd2f6972b@googlegroups.com>... > On Thursday, July 26, 2012 8:32:10 AM UTC+12, vj wrote: > > hi, > > > > I am using textread to read values from a text file. > > when i use the following command, > > > > file = textread('1.txt','%s','delimiter','\n'); > > file{1,1} > > ans = > > C0-3F-0E-90-EE-13 6 "NETGEAR" -63 11.75 > > > > I would want C0-3F-0E-90-EE-13,6,"NETGEAR"-63, 11.75 as a form a structure, instead of one variable. > > I am not sure how to use the delimiter to get the same. > > > > Can someone please help me on this. > > Use textscan instead: > > fid=fopen('1.txt','rt'); > c=textscan(fid,'%s%f%s%f%f'); > fclose(fid); > > textscan assumes whitespace as the default delimiter > c will be a cell array of your data
Thank you for your reply!! :) It helped me a lot!!
|
|
|
|