I am reading a .xls file and then procesing it inside and rewriting it in the end of my program. I was wondering if someone can help me to parse the dates
as my input file name is like file_1_2010_03_03.csv
and i want my outputfile to be
newfile_2010_03_03.xls
is there a way to incorporate in matlab program so i do not have to manually write the command
xlswrite(‘newfile_2010_03_03.xls’, M);
everytime and change the dates as i input files with diff dates
like
file_2_2010_03_04.csv.
Maybe i was not clear>
I am using uigetfile to input 3 diff files in format
file_1_2010_03_03.csv,file_2_2010_03_03.csv,file_3_2010_03_03.csv
Now i am processing the file inside my program and writing 4 output files
with names newfileX_3_2010_03_03.xls,newfileXY_3_2010_03_03.xls,newfileXZ_3_2010_03_03.xls,
newfileYZ_3_2010_03_03.xls
so my dates are not current date , but i need that from the input file and append that to newname for my xlswrite.
so was wondering if there is a way i can write a generic
xlswrite (‘xxx ‘ M);
which will pick the name i want instead of me having 2 modify the name’ xxx’ everytime i input a new file
Thanks
Thanks
It looks like I misunderstood what you meant with ‘file_1’, ‘file_2’ – I thought the numbers 1 and 2 had some kind of importance.
Older Version with Explanations
I assume that the date in all your files is the same. So your program would go
See regular expressions for more details on how to use them. Also, you may be interested in
uipickfiles to replace uigetfile.