[Scilab-users] CsvRead function

Clément David Clement.David at esi-group.com
Wed May 13 10:13:33 CEST 2020


Hello all, hello Daniel,

There has been some modification on the csvRead code to speed things up and there might be some issue in the new code. If you can reproduce with a reduced CSV file, could you open a bug with a sample of your code ?

Thanks,

--
Clément


From: users <users-bounces at lists.scilab.org> On Behalf Of Jan Åge Langeland
Sent: Tuesday, May 12, 2020 1:41 PM
To: Users mailing list for Scilab <users at lists.scilab.org>; Daniel Stringari <danielstringarita at gmail.com>
Subject: Re: [Scilab-users] CsvRead function


csvRead is quite strict regarding column structure etc, but the associated error message is typical "can not read......". So when it reports "does not exist", it looks like the file is missing, or misplaced. If you still think the file is there, you may try this script that I have used to check csv files:

//Read CSV file -JÅ 2020

datafile="test.csv";

separators=[ascii(9),";"];

decimal=",";

headerlines=2;

linestoread=-1;// -1 for all

footerlines=2;

fid = mopen(datafile,'rb');

csvline=mgetl(fid,linestoread);

mclose(fid);

clear dataset;

n=size(csvline,1);

for k=1:n

    if k>headerlines && k<n-footerlines+1 then

       datatemp=strtod(strsplit(csvline(k),separators),decimal);

       dataset(k-headerlines,1:length(datatemp))=datatemp;

    end

end



disp(csvline(1:headerlines))

disp(dataset)

disp(csvline(($-footerlines+1):$))



Jan


On 2020-05-12 10:20 AM, Daniel Stringari wrote:
Good Morning,

The file exists ... Every time the code is run, it tries to create a series of files inside the address "C: \ Temp \ PGC \ ..." using the functions FULLFILE, CSVWRITE, CSVREAD and MDELETE to create and manipulate the data. This tool always worked in version 6.0.2 and when upgrading to version 6.1, it started to give an error with the code identical to the previous version, so my first suspicion was in relation to the mentioned functions.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20200513/297ebd1e/attachment.htm>


More information about the users mailing list