Loading of file problem.
Loading of file problem.
(OP)
Hi,
I have a set of .csv files which i can convert using a converter which i can call thru matlab using dos command,the problem is, i have around 10 files to convert one by one and here is the code i wrote, but i couldnt get it done because in the path for the conversion if i say 's' it doesnt recognise my file name which is suposed to be 'a_1.csv' rather it is searching for s.csv
need your help to solve this problem,
for d = 1:4
s = ['a_' int2str(d) '.csv']
dos('C:\exec\callconverter.exe "C:\Project\s" "C:\Project\s" -C:\Exec\Ascimpconv.dll -IF:"C:\Exec\Project\canape.ini"')
load(s)
end
waiting for your reply,
with kind regards,
vinod.b
I have a set of .csv files which i can convert using a converter which i can call thru matlab using dos command,the problem is, i have around 10 files to convert one by one and here is the code i wrote, but i couldnt get it done because in the path for the conversion if i say 's' it doesnt recognise my file name which is suposed to be 'a_1.csv' rather it is searching for s.csv
need your help to solve this problem,
for d = 1:4
s = ['a_' int2str(d) '.csv']
dos('C:\exec\callconverter.exe "C:\Project\s" "C:\Project\s" -C:\Exec\Ascimpconv.dll -IF:"C:\Exec\Project\canape.ini"')
load(s)
end
waiting for your reply,
with kind regards,
vinod.b





RE: Loading of file problem.
"C:\Project\s"
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Loading of file problem.
there is a mistake remove the load(s) command,when i say c:\project\s - s should be a_1.csv and it should fetch this file in the above directory, but it looks for s.csv and it couldnt find anything and it cannot run, so how to solve this problem.
waiting for your reply,
thanks,
vinod.b
RE: Loading of file problem.
CODE
-C:\Exec\Ascimpconv.dll -IF:"C:\Exec\Project\canape.ini"'])
M
--
Dr Michael F Platten
RE: Loading of file problem.
here is the function,
dos('C:\Project\splitCSV.exe C:\Project\a.csv 50')
here a is example, but my file names will vary each time,as i cannot load the file in matlab, because it is a csv file,i would like to enquire this file name and store it and then give this name in the above function,
how can i do that,
waiting for your reply,
thanks,
vinod.b
RE: Loading of file problem.
M
--
Dr Michael F Platten
RE: Loading of file problem.
i have used the following code to get the filename,
[fileName,PathName] = uigetfile('*.csv', 'Pick one');
fileandpath = strcat(PathName,fileName);
k = fileName
dos(['C:\Project\splitCSV.exe C:\Project\' k ' 50'])
for d = 1:3
s = [' k_ ' int2str(d) '.csv']
t = [' k_ ' int2str(d) '.mdf']
u = [' k_ ' int2str(d) '.mat']
% Process the contents of the d-th file
dos(['C:\exec\callconverter.exe "C:\Project\' s '" "C:\Project\' t '" -C:\Exec\Ascimpconv.dll -IF:"C:\Exec\Project\canape.ini"'])
dos(['C:\exec\callconverter.exe "C:\Project\' t '" "C:\Project\' u '" -C:\Exec\Matconv.dll -IF:"C:\Exec\Project\canape.ini"'])
end
now for example if my file name is vinod.csv it stores in k as vinod.csv, now i want to take this 'vinod' alone from the string in the K and feed it for s,t,u. so that i could run the file name i want to and not with extension.
how can i do that,
waiting for your replies,
thanks,
vinod.b
RE: Loading of file problem.
M
--
Dr Michael F Platten
RE: Loading of file problem.
use FULLFILE to concatenate PathName and fileName.
And use FILEPARTS to get the file extension.
Jérôme
RE: Loading of file problem.
thanks for your replies,
i have a command down here where value of e is 200 but when i run this, it is not taking e's value and it isnt working properly can someone guide me why,
dos([['C:\Project\splitCSV.exe C:\Project\' fileName ' e ']])
waiting for your reply,
vinod.b