T
T
Tyoma Makeev2015-08-15 14:26:22
excel
Tyoma Makeev, 2015-08-15 14:26:22

How to split a folder with pictures into many folders by CSV (or excel) table?

There are several folders, each of which contains a lot of pictures and a CSV (or Excel) table. The first line in the table is the name of the column, the first column is the name of the product, the second column is the names of the image files related to this product, separated by commas, the subsequent columns are some characteristics of the product. You need to turn it into a bunch of folders with names from the first column, each of which contains pictures selected by the names from the second column and a text file like this:
Column name 3: value
Column name 4: value
Column name 5: value
Can you tell me either a ready-made solution, or a tool for solving similar problems, in the direction of which you should look? The first thing that came to mind was a bunch of bash, awk / sed or Excel VBA, but since I don’t know how to properly use either the first one, or, especially, the second one, I ask if anyone has come across something like this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2015-08-15
@murmuringvoices

here any programming language that you know
VBA can probably do, but the language is stupid, I would choose Python:
CSV will allow you to count line by line and perform manipulations with each line: 1) create a folder 2) copy 3) create a text file and write
the code, see link above, something like

>>> import csv
>>> with open('names.csv') as csvfile:
...     reader = csv.DictReader(csvfile)
...     for row in reader:
...         print(row['first_name'], row['last_name'])

work with files - for example, on pythonworld.ru or sackoverflow, there you need to learn 3-4 operations and write them down in the correct sequence

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question