2
1
I need to clean up strings like this (where I read in a group of image names), where I only want the first two strings (currently I'm using, in Windows 7 cmd line - dir /a/b/p > textfile.txt):
- Acaena inermis no barbs dbot_25Dec15_40.JPG
- Coprosma Taiko PB121944 invbot.rs.JPG
- Cortaderia richardii InvBot P6260038.JPG
- Anemanthele lessoniana LIC.nestmaker.CC BY-SA 2.0.jpg
- Myosotidium hort ibot PB109882 sqr rs.JPG
to look like this (Word space word and strip the rest):
- Acaena inermis
- Coprosma Taiko
- Cortaderia richardii
- Anemanthele lessoniana
- Myosotidium hort
Is there a way using either cmd or batch to simplify this? Normally there would be 15 files parsed each time I do this. I'm hardly a cmd-line guru!
Just to clarify things, are you looking to rename files to word space word? without the extension even? – LPChip – 2016-05-10T07:37:33.867
Possible duplicate of How can I mass rename files?
– LPChip – 2016-05-10T07:38:55.633One of the answers lists PowerGrep which seems to also replace regex inside files. That's one you may want to use, or use something like Notepad++ where you can find/replace using regex inside a textfile. – LPChip – 2016-05-10T07:43:31.150
Thanks very much LPChip, I'll look at these tomorrow and get back here – nigelc – 2016-05-10T08:18:24.633
Can you show us what you've tried with the batch file? – Dave – 2016-05-10T08:25:21.587