Dec-05-2019, 12:55 PM
I would like to sort image files with same tags into a specific folder.
(The HAM 10000 dataset, https://dataverse.harvard.edu/dataset.xh...DVN/DBW86T)
A metadata file (HAM10000_metadata.csv) was made like this;
lesion_idimage_iddxdx_type age sex localization
HAM_0000550ISIC_0024306nv follow_up 45 male trunk
HAM_0003577ISIC_0024307nvfollow_up 50 male lower extremity
HAM_0001477ISIC_0024308nvfollow_up 55 female trunk
HAM_0000484ISIC_0024309nvfollow_up 40 male trunk
HAM_0003350ISIC_0024310melhisto 60 male chest
HAM_0000981ISIC_0024311nvfollow_up 75 female back
HAM_0001359ISIC_0024312bklhisto 75 male lower extremity
HAM_0002869ISIC_0024313melhisto 50 female back
HAM_0002198ISIC_0024314nvhisto 75 male lower extremity
.
.
. so on
And, all image files were named after image_id (ISIC_XXXXXXX.jpeg).
What I want is to sort these image files (ISIC_XXXXXXX.jpeg) according to the variable, "dx" (nv, mel, bkl,...) ! In a metadata file (HAM10000_metadata.csv), there are seven different values of "dx" (akiec, bcc, bk1, mel, df, vasc, nv).
Therefore, I want to put these 10,000 image files with a same value of "dx" into 7 different folders according to the metadata file which contains the macthed value of "dx" of every image file.
How can I make a script?
(all files are located at c:\ and I would like make new seven folders with same name of "dx")
Thank you for your help!!
(The HAM 10000 dataset, https://dataverse.harvard.edu/dataset.xh...DVN/DBW86T)
A metadata file (HAM10000_metadata.csv) was made like this;
lesion_idimage_iddxdx_type age sex localization
HAM_0000550ISIC_0024306nv follow_up 45 male trunk
HAM_0003577ISIC_0024307nvfollow_up 50 male lower extremity
HAM_0001477ISIC_0024308nvfollow_up 55 female trunk
HAM_0000484ISIC_0024309nvfollow_up 40 male trunk
HAM_0003350ISIC_0024310melhisto 60 male chest
HAM_0000981ISIC_0024311nvfollow_up 75 female back
HAM_0001359ISIC_0024312bklhisto 75 male lower extremity
HAM_0002869ISIC_0024313melhisto 50 female back
HAM_0002198ISIC_0024314nvhisto 75 male lower extremity
.
.
. so on
And, all image files were named after image_id (ISIC_XXXXXXX.jpeg).
What I want is to sort these image files (ISIC_XXXXXXX.jpeg) according to the variable, "dx" (nv, mel, bkl,...) ! In a metadata file (HAM10000_metadata.csv), there are seven different values of "dx" (akiec, bcc, bk1, mel, df, vasc, nv).
Therefore, I want to put these 10,000 image files with a same value of "dx" into 7 different folders according to the metadata file which contains the macthed value of "dx" of every image file.
How can I make a script?
(all files are located at c:\ and I would like make new seven folders with same name of "dx")
Thank you for your help!!
