Sign in to follow this  
Followers 0
Skulll0

Script output text verbatim

3 posts in this topic

Hi all,

I'm pretty new with AutoIT and scripting in general.

I'm using this tool to type in extensive queries into a program (ADP Drive, Automotive industry) and the queries generate reports.

The problem is that these long queries used quotes, parenthesies and other odd characters.  I also need to be able to dump a really long power shell command, that has the same issue.

Rather than typing out a Send ("giant command string here") is there a way to make it call the contents of a text file and have that text file contain the huge string?   And hopefully it dump the contents of the text file verbatim?

One of the powershell strings I need to issue is:

(gc C:adpautomationhondaaaxoutputsHTO_Accounting.csv) | % {$_ -replace '"', ""} | out-file C:adpautomationhondaaaxoutputspowershellconvertedHTO_Accounting.csv -Fo -En ascii

Any help is greatly appreciated!!

-g

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You just need to know when to double up on the quotes...output them to the console for debugging...2 ways to do the same output:

output:

$string = '(gc C:\adpautomation\honda\aax\outputs\HTO_Accounting.csv) | % {$_ -replace ''"'', ""} | out-file C:\adpautomation\honda\aax\outputs\powershellconverted\HTO_Accounting.csv -Fo -En ascii'
ConsoleWrite($string & @CRLF)

$string = "(gc C:\adpautomation\honda\aax\outputs\HTO_Accounting.csv) | % {$_ -replace '""', """"} | out-file C:\adpautomation\honda\aax\outputs\powershellconverted\HTO_Accounting.csv -Fo -En ascii"
ConsoleWrite($string & @CRLF)

(gc C:adpautomationhondaaaxoutputsHTO_Accounting.csv) | % {$_ -replace '"', ""} | out-file C:adpautomationhondaaaxoutputspowershellconvertedHTO_Accounting.csv -Fo -En ascii

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Hi Skull0,

  And Welcome to the Forums !

You can also get your text from a file... 

FileReadLine

FileReadToArray

or similar

Once you get the "Strings" you can manipulate them using the string commands

see my sig for an example. :D

Bill

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  
Followers 0