Jump to content
Sign in to follow this  
grakker

@Comspec

Recommended Posts

grakker

I'm really having a hard time with this. From a dos window I can run:

C:\Whatever\Directory>sed 's/","/ /' c:\StartingFile > c:\EndingFile

Which works great. Runs about 2 seconds on a 90,000 line file. It should be simple to run from Autoit. Yet this:

RunWait(@ComSpec & ' /c ' & @SystemDir & "\sed 's/"",""/ /' c:\StartingFile > c:\EndingFile", @SW_HIDE)

Gives the following error:

C:\AutoItFiles\CleanCustomerBridge.au3 (29) : ==> Unable to execute the external program.: 
RunWait(@ComSpec & ' /c ' & @SystemDir & "\sed 's/"",""/ /' c:\StartingFile > c:\EndingFile", @SW_HIDE) 
The directory name is invalid.

I've tried it w/o the @SystemDir and as many different variables as I could try. Thanks in advance.

Share this post


Link to post
Share on other sites
SlimShady

This is tested with the ECHO command:

RunWait(@ComSpec & ' /c sed ''s/","/ /'' c:\StartingFile > c:\EndingFile', @SystemDir, @SW_HIDE)

Share this post


Link to post
Share on other sites
grakker

this is how I run my AWK stuff in win 98:

$val = RunWait("C:\GAWK\BIN\gawk.exe -fd:\prg\printcnt.awk d:\user\cnt\*.cnt")

(AWK is SED's older brother)

<{POST_SNAPBACK}>

Coming from *nix, I'm pretty versed in most common CLI apps. My problem was that I wasn't reading the help file correctly. I just needed to add and extra parameter to the RunWait command in order to use the @SW_HIDE option.

Thanks everyone.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.