| Newsgroups |
gmane.mail.blat |
| Message-ID |
<[email protected]> |
http://www.dostips.com/DtTipsStringManipulation.php
Mike Mattos
“To succeed in the world it is not enough to be stupid, you must also be well-mannered”
Voltaire
From: [email protected] [mailto:[email protected]]
Sent: June 8, 2017 3:31 AM
To: [email protected]
Subject: Re: [blat] Can Blat be used when name of the attached file is unknown?
Thanks. That was helpful indeed!
Now I am only stuck with Variables inside a FOR DO loop ...
I know that this is beyond the scope of this group, but, as the results I get while attempting to resolve this issue also seem to confuse Blat, I post this follow-up now.
Here is the Situation and what I want to achieve:
Folder C:\POS\PrintFiles contains one or several .txt files.
The text files have the Rundate in their names, i.e. Print201706.txt, Print201707.txt and so on.
I want to use Blat now to send one mail for each of the found printYYYYMMDD.TXT files, with the Date Part of the Filename as Part of the Subject Line, and the Text File in the Message Body.
I need to do a For DO loop here:
FOR 55f in(C:\POS\PrintFiles\Print*.txt DO
(C:\POS\Blat\blat.exe %%f -tf "C:\POS\Blat\recipients.text" -subject "Your ales Results from (_Replace these words here with correct Syntax:The Substring of the current file of the loop which represents the Date in numbers format YYYYMMDD_) -sig "C:\POS\Blat\sig.txt -log C:\POS\Blat\log.txt"
)
In case I use %%f as placeholder in the -Subject line, I get the expected result:
My Subject is "Your Results from C:\POS\PrintFiles\Print20170608.txt".
Correct, but not very helpful.
The Substring command to receive 20170608 from the full filename is %VARIABLE:~34,8%. But the Subsitution seems to be not working! The :~34,8 just gets appended to the Subject String ...
What am I doing wrong here?