[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: xlsx processing
From: |
Ian McCallion |
Subject: |
Re: xlsx processing |
Date: |
Mon, 16 Mar 2020 14:36:16 +0000 |
On Mon, 16 Mar 2020 at 13:20, mrodrig via Help-octave
<address@hidden> wrote:
>
> I have worked a little more and I found this way to do it but I do not know
> if it is the best
> data.xlsx <https://octave.1599824.n4.nabble.com/file/t372706/data.xlsx>
> clc
> clear all
> pkg load io
>
> [data_v, title_v]=xlsread("data.xlsx");
> [rows, columns] = size(data_v)
> rows
> columns
> for i=1:columns
> v=data_v(5:326,i);
> FileName=sprintf("%s.txt",[title_v{1,i}, "_", title_v{2,i},
> "_",title_v{3,i}])
> save (sprintf (FileName, i), "v")
> i=i+1;
> end
That looks pretty good to me! Although given that you said there were
three information rows at the head of each column, I'm not sure why
you coded
v = data_v(5:326,i)
Should it not have been 4:326?
Also you can very conveniently use the "end" keyword inside array indices, so
v = data_v(5:end,i)
Cheers... Ian