Jump to content

Search the Community

Showing results for tags 'stringreplace'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


WWW


Interests

Found 15 results

  1. 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() output is: $sSubject = "?? 5 of the Best Stocks to Buy for December" 3) I perform StringReplace(): $sSubject = StringReplace($sSubject, "??", "
  2. I am adding labour charge to total paid amount using : #include <IE.au3> #include <Array.au3> $oIE = _IEAttach ("Shop") $oTable = _IETableGetCollection ($oIE, 1) $aTableData3 = _IETableWriteToArray ($oTable) Local $sitem1 = $aTableData3[5][1] Local $sitem2 = $aTableData3[5][2] Local $lcharge = "10" ;add manualy using inputbox, becuase not generating online Local $atotPric = "Payable Total Price " Local $oTds = _IETagNameGetCollection($oIE, "td") For $oTd In $oTds If $oTd.Innertext = $atotPric Then $iatotPric = $oTd.Next
  3. Default keyword for optional parameter is interpreted wrongly. ConsoleWrite(StringReplace("aa", "a", "b", Default, 1) & @CRLF) StringReplace ( "string", "searchstring/start", "replacestring" [, occurrence = 0 [, casesense = 0]] ) The code above will output ab even thou the default value for the occurrence is 0 (replace all). Of course using zero instead of Default will work fine.
  4. Hi All, I have written a UDF for one of my requirement which replaces a single character in string with a sub string/another character. I am using this for my requirement by calling below function as StrReplace("C:\Software\Autoit\Substr","\","\\") and gives result as C:\\Software\\Autoit\\Substr Please let me know if this can be improvised or any mistakes to correct. ;=============================================================================== ; ; Function Name: StrReplace($INPUT_STRING) ; Description: This function is to replace a chara
  5. Hi! I have another problem with AutoIT. You see, I'm still the one who's just starting out with this great programming language. I have a problem with AutoIT, it seems not to recognize the "StringReplace" function even when it is by default. The code was made half in KODA and half of my own. It is a software programmed for the Italian language (I am Italian) and translate the SMS language into Italian correct. Would you help me? Thanks in advance. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConst
  6. Junior Programmer here... Not much experience with opening, changing and closing files. I am trying to replace strings in a Text file except StringReplace does not actually replace the text. Here is a sample of my code... #include <File.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> Local $iStrReturn = 0 Local $hFile Local $sText Local $sNewText ; Location of File to be read $sFileName = "C:\Temp\MyPlayer.exe.config" ; The default is FALSE. We want to change this to TRUE $bLoopChecked = True CheckBox() Fun
  7. Hello hello! As the title suggests, I am fairly new to AutoIt. In fact, I am new to scripting/coding in general! I've done a few Codecademy courses on CSS and HTML and perhaps Java though this was all a few years back. I've recently come across AutoIt and decided to give it a try since I do quite a few repetitive tasks on a daily basis. In the last couple of weeks I've managed to master (or at least get comfortable with) mouse clicks(left/right), window focus, sending key strokes, controls, and pixel search. Now let's get to the topic. At this point in time I've tried out a few
  8. Hello, I try to pull some data from a webpage. I need the value of local currency compared to the euro. I can go and open the required API page on the required date interval, read in from elsewhere, its format in the memory of the script is like this: 20161005 so YYYYMMDD. The return string if I try to view the opened API's source code is simple, but if I use _IEBodyReadHTML, _IEDocReadHTML, _IEBodyReadText i get it back with a lot of html code (i guess, it looks like HTML, and one of them doesn't show any string in the MsgBox when I try to chechk it) about its color etc. I need date
  9. Hey guys Can anyone help me explain this? $szFile = "test.htm" $szText = FileRead($szFile) $szText = StringReplace($szText, "hello", "ö") FileDelete($szFile) FileWrite($szFile,$szText) If the file "test.htm" has it's text changed into something containing non US characters, in this example "ö", the output is " ö " when shown in a browser. If i manually change the text in the "test.htm" file to "ö" - the output in the browser is "ö" ! In both cases, if the htm file is opened in notepad, the content is just "ö" - but the one change
  10. Hello. I need to perform a specific string replace, but not sure how to go about it. The scenario is this: I have a large block of text. Within the text colons appear ":", Sometimes the colons are used in a sentence appearing after a word. Other times they appear in between numbers like a ratio or a sport score (e.g. "6:8"). I want to replace the colons appearing between numeric values like 6:8 with the word "to", but not the ones appearing at the end of a sentence. Is there a way that I can have StringReplace (or any other method) differentiate when to replace the colon based
  11. Im trying to edit a file, I want to find a string which has a line break in it, and replace it with a string that has multiple line breaks in it. editfile.txt looks like this: dog cat mouse chicken my au3 script looks like this but is not working, i suspect because of how I am trying to do the line breaks? Func EditFile($CurrentFile) $szFile = "$CurrentFile" $szText = FileRead($szFile,FileGetSize($szFile)) $szText = StringReplace($szText, "Cat" & @CRLF & "Dog", "Hippo" & @CRLF "Lion" & @CRLF & &
  12. Nothing amazing but I use it all the time, I'm surprised something similar hasn't been added to the standard StringReplace. I've never been any good at regular expressions, I'm sure if I was the whole example below could be done in one line But for the simple minded like me here you go Enjoy$BIOS = _StringMultiReplace(CleanWMIC("bios", "biosversion"), "(|)|{|}", "") Func _StringMultiReplace($zString, $zSearchString, $zReplaceString, $zDelimeter = "|") If $zString = "" OR $zSearchString = "" OR $zDelimeter = "&
  13. Hi, i wrote a script that can replace multiple strings in a xml file works fine but so slow! I've used StringReplace ,_ReplaceStringInFile, StringRegExpReplace, all the same very slow,. The number of replacements in the file about 8000 Any help would be greatly appreciated #include <File.au3> $path = @ScriptDir & '\xmlfo.xml' $OXML = FileOpen($path, 256) $XML = FileRead($OXML) $term = 'post' $nofr = 1 Local $aArray = StringRegExp($XML, '(?s)<entry[^>]*>.*?</entry>', 3) FileClose($OXML) $XL = $XML If Not @error Then For $i = 0 To UBound($aArray) - 1 ;get dat
  14. Hi all, Im trying to replace a string with only relevant information. My first thought was the stringreplace function. The string i wish to cutdown: HospitalInfo.set2("HospitalInfoCash", "<b>Cash</b> - ","&euro;&nbsp;1,270,876"); The information i would like to keep is the cash amount: 1,270,876 From the helpfile: #include <MsgBoxConstants.au3> ; Replace a blank space (' ') with a - (minus) character. Local $sString = StringReplace("This is a sentence with whitespace.", " ", "-") Local $iReplacements = @extended MsgBox($MB_SYSTEMMODAL, "", $iReplacemen
  15. I'm trying to replace all occurrences of one string in a binary file with another string (e.g. all "C:\" with "D:\"), but StringReplace() does nothing. I opened my files in Binary mode and set the data read in to binary(), but nothing works. My test script reads a compiled version of the script, does the replacements, then writes the results to an output file. Prior to calling StringReplace(), I call StringInStr() to see if my 'from' string is found. The StringInStr() reports that it found the string, but the StringReplace() reports 0 replacements. Just to be sure, I did a binary co
×
×
  • Create New...