
I have been tasked with creating a batch file that will remove the leading zeroes from strings of data that are exported out of our software into a .txt file. I would like the script to run every day AT 6:30 pm.
An Example of the data that I would like the batch file to address: (The actual file is 98 KB of similar output)
"000000095955","LastName",0.00,"","","","","","","","","",""
"000000092627","LastName",5.43,"","","","","","","","","",""
"000000099218","LastName",1.98,"","","","","","","","","",""
"0000000091042","LastName",0.00,"","","","","","","","","",""
"000000099781","LastName",1.87,"","","","","","","","","",""
"000000082889","LastName",0.32,"","","","","","","","","",""
First: I have to remove / escape the leading quotation character in order to access the following string of zeroes (http://www.dostips.com/DtTipsStringManipulation.php#Snippets.RemoveBothEnds but only remove the first character)
Second: The string length of zeroes that precede the non-zero integers in the string vary from 6-8 zeroes so I would like to trim zeroes up to the non-zero integer (trim up to 'not zero' in the first string of 10 characters) and leave the following characters alone
Third: Concatenate the leading quotation back onto the beginning of the edited (no leading zeroes) string FOR every line
Fourth: Output the edited data into a new .txt file in the same directory as the executing script
Fifth: Ideally, I make use of the AT functionality in BATCH and have the script execute on the .txt file every day at 6:30 pm
Sixth: If the directory in question has multiple .txt files inside of it; would it be possible to have the BATCH file look through all the .txt files in the directory and locate the particular .txt file that begins with a string of six zeroes ("000000") and have the script only execute on this file?
Thank you for any and all help; it is extremely appreciated and I really value the input of this community
dostips has been a godsend these past few days