Hey everyone, a noob here :)
Was wondering if there is a way to use ExifTool to do the following:
1) select a column from a csv file and then for each row in that column
2) count comma-separated words
3) if the count is 50 or under, leave everything as it is
4) if the count is over 50, remove the extra words *and here's the kicker* without removing the last 5 words (so, remove the 6th word from the end if there are 51 words, 6th and 7th from the end if there are 52 words etc.)
I have some very basic Python knowledge, but no idea where to start with ExifTool commands, if it's even possible to do that exact thing.
Thanks a lot in advance.
Exiftool doesn't have CSV editing tools (AFAIK).
But you might take a look at CSV Kit (https://csvkit.readthedocs.io/en/1.0.2/). It might have something you can use. Though I think it's going to require some actual scripting.
Upon further research, it doesn't seem like CSVKit has search/replace ability.
What OS are you using? If Linux/Mac, you might be able to use sed. I'm making some assumptions about how your csv is setup, but a Regex like this (https://regex101.com/r/hCYYOf/2) (s/^"((?:.*?,){45}).*,((?:.*?,){4})(.*?)"$/$1$2$3/) for just that column might work. Applying it to just the one column would be the problem.