|
DitzaN <ditzaspam@gmail.com> wrote in message <1375586088.34682.1291208405543.JavaMail.root@gallium.mathforum.org>...
> Hi,
>
> I have csv file in this format
>
> 5
> 56 65 6
> 6
> 46 65
> ABC
>
> I need only specific line of the file.
>
> I now I can use this code
> fid=fopen('filename');
> C = textscan(f, '%s')
> RelevantLine=C{1}{LineNum};
>
> Is there is why to read only the line I need?
>
> thanks,
> Ditza
Hi,
Use following line:
C = textscan(fid, '%s','delimiter', '\n');
> RelevantLine=C{1}{LineNum};
Yes, it gives you the line you want to read.
You can also use textread:
C = textread('filename', '%s','delimiter', '\n');
In this case you get your line using:
C{LineNum};
Regards.
|