Given a text file file.txt containing
XXX-YYY-ZZZZ some other text
AAA-BBB-CCCC more text
UUU-VVV-WWWW etc etc
and a Windows .bat file
I'm seeking for a solution such that the string from each beginning of the line up to the first blank (excluding) will be extracted from the file and be given an executable in the .bat file as an argument.
The UNIX sh/sed pendant to which the following would be:
for i in `cat file.txt | sed 's/ .*$//' `; do echo $i; done
with "echo" standing as a placeholder for the executable I would like to pass the argument to.