Search found 3 matches

by whdyck
22 Aug 2012 09:28
Forum: DOS Batch Forum
Topic: Assign %1 Parameter to a set Variable for Manipulation
Replies: 6
Views: 4441

Re: Assign %1 Parameter to a set Variable for Manipulation

foxidrive wrote:You need to use delayed expansion and then !fname! instead of %fname%
Be aware that it has some limitations: such as ! characters break it.

Or you could set fname=%1 before the loop begins.


That worked! I had never heard of delayed expansion. :D

Thanks very much for the help.

Wayne
by whdyck
21 Aug 2012 20:56
Forum: DOS Batch Forum
Topic: Assign %1 Parameter to a set Variable for Manipulation
Replies: 6
Views: 4441

Re: Assign %1 Parameter to a set Variable for Manipulation

Yes, I tried that, and I couldn't get it to work. Maybe I'm just making a bonehead error in my syntax. Here's what I tried: for %%f in ("???.lia.*") do call :ProcessLIA %%f . . . :ProcessLIA rem Run the file parser ..\awk.exe -v CurrDateTime=%CurrDateTime% -v LogFile=%LogFile% -f ..\lia.aw...
by whdyck
21 Aug 2012 15:30
Forum: DOS Batch Forum
Topic: Assign %1 Parameter to a set Variable for Manipulation
Replies: 6
Views: 4441

Assign %1 Parameter to a set Variable for Manipulation

Hi, I have a subroutine that receives as a parameter a filename that looks like cgc.lia.20120821.081234 I'd like to substitute a hyphen for those periods and tack on a ".csv" (so I can import the file into Access). My code looks like this: :ProcessLIA rem Run the file parser ..\awk.exe -v ...