Recently Browsing 0 members
No registered users viewing this page.
I am looking for a script to replace the string in 2 different files types.
I have .hod files and .ws files. These are AS/400 Session file types.
If you open the files with a text editor you can change the Host they are connecting to.
I need to change if needed to a Standard Host name.
.HOD file has a line host=X.X.X.X or something of the sort and I need it to be host=DNSName
.WS file has a line HostName=X.X.X.X and needs to be HostName=DNSName
It would be nice to be able to run this script silently on the PC if running with a switch (can do with software deployment) and if a person wanted to run it manually they would get a pop-up on how many it changed. The bad thing is these files could be in quite a few different places on the PC. If I could put in the script the most common places to look for the files that would be good to. I also just found out that if the session is open and you change the string, when you close the session it changes the string back to what it was. I guess maybe error with "sessions need to be closed" if there is a certain exe running.
Thank you in advanced for any help you can provide.
Thank you so much in advance for your help! I've been using AUTOIT for manipulating gcode. So far I've just worked through the excellent help examples and although I'm sure the resulting code is clumsy it has functioned
However now I'm trying to improve and advance things and I've stumbled across REGEX.. and I'm a bit stuck. What I would like to be able to do is to 'move'/'transform' the gcode in a file and re-write it to a new file. I only need to move it in one direction(X). At the heart of this I need a script to extract all the X values and then ADD or SUBTRACT an adjustment factor to transform and rewrite the code accordingly.
So far using an example script and an example input -
Local $iMove = -4
Local $sInput = '"G1 X45.036 Y6.934 F7800.000 G1 Z0.600 F7800.000 G1 F900 G1 X48.036 Y1.076 E0.58925"'
Local $sOutput = StringRegExpReplace($sInput, '(?<=[X])\d+.\d+', '\0')
This identifies the correct values i.e 45.036 and 48.036 but is there a way to dyamically adjust them before they are replaced, by for example a factor of -4 ($iMove above). So far I can't seem to do math on the '\0' value i.e '\0'+ -4 ?
Many thanks for your time and expertise!
As for the object, in this case the StringReplace() function does not work for me.
These are my steps:
1) Extract the subject from an EML file.
(the first character is an emoji )
source from EML file:
$sSubject = "?utf-8?B?8J+TiCA1IG9mIHRoZSBCZXN0IFN0b2NrcyB0byBCdXkgZm9yIERlY2VtYmVy?=" 2) in this case I perform a decoding with _QuotedPrintable_DecodeEncodedWord()
$sSubject = "?? 5 of the Best Stocks to Buy for December"
3) I perform StringReplace():
$sSubject = StringReplace($sSubject, "??", "") or
$sSubject = StringReplace($sSubject, Chr(63)&Chr(63), "")
But the characters ?? they are not replaced.
Yet if I make an Asc of every character of the string with a for loop, are the first two characters really? that is 63
Local $aArray = StringSplit($sSubject, "", $STR_NOCOUNT) For $i = 0 To UBound($aArray)-1 ConsoleWrite($aArray[$i] & " - " & Asc($aArray[$i])& @CR) Next Output:
? - 63
? - 63
5 - 53
o - 111
f - 102
t - 116
h - 104
e - 101
Does anyone have an explanation of why it doesn't work?
Thank you all
i am trying to get number from string using this code :
#include <IE.au3> $oIE = _IEAttach ("Edu.corner") Local $aName = "Student name & Code:", $iaName = "0" Local $oTds = _IETagNameGetCollection($oIE, "td") For $oTd In $oTds If $oTd.InnerText = $aName Then $iaName = $oTd.NextElementSibling.InnerText $iGet = StringRegExpReplace($iaName, "\D", "") EndIf Next MsgBox(0, "", $iGet) it was get number like 52503058
But, I want to get only student code 5250. (Different student have different code, sometime its 3 digits, Sometime 4)
i've some questions about StringRegExpReplace i hope you can help me
i tried to make a function that give me the host of the url and other give me the url with out host
for example i've this link
i need the first give me the
and the other give me
i find that
$s_source = "https://www.google.com/vb/index.php" Local $s_Host = StringRegExpReplace($s_Source, '.*://(.*?)/.*', '\1') Local $s_Page = StringRegExpReplace($s_source, '.*://.*?(/.*)', '\1') msgBox(64, $s_Host, $s_Page)
but i found some problems i need your help to correct it
first: when i get the host if the url has www i want to remove it
second: if the url with out host did not have other things
i need the result to be ""
the first i want it
and the second i want it to be ""
i hope that you can help me
thanks in advance