I have a folder that contains pictures of receipts that are named in a specific way. Date first in reverse format (ex. 21/11/2015 -> 15_11_21
) followed by a space and then the value of the receipt (ex. 18,45 -> 18_45
)
Let's say the files are stored in location C:\pictures\receipts
. In this folder I have 3 files:
15_11_21 18_45.jpg
15_11_22 115_28.jpg
15_12_02 3_00.jpg
I want to create an array that has 3 columns. The first column contains the date of the receipt in normal format, the second column contains the value in negative and the third column has the absolute path of the file. The array should be like this:
Receipts = [21/11/2015|-18,45 |C:\pictures\receipts\15_11_21 18_45.jpg
22/11/2015|-115,28|C:\pictures\receipts\15_11_22 115_28.jpg
02/12/2015| -3,00 |C:\pictures\receipts\15_12_02 3_00.jpg];
I tried modifying/combining various functions like getting the full path:
[status, list] = system( 'dir /B /S *.mp3' );
result = textscan( list, '%s', 'delimiter', '\n' );
fileList = result{1}
strsplit
to separate the values of the filenames, and even this function, but I cannot get the desired result.