Skulll0 Posted January 24, 2014 Share Posted January 24, 2014 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 Link to comment Share on other sites More sharing options...
jdelaney Posted January 24, 2014 Share Posted January 24, 2014 (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 January 24, 2014 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. Link to comment Share on other sites More sharing options...
l3ill Posted January 24, 2014 Share Posted January 24, 2014 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. Bill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now