Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/18/2018 in all areas

  1. no such thing. the converter would be you.
    2 points
  2. Maybe with StringRegExpReplace: https://regex101.com/r/z6BWJD/1
    2 points
  3. StringRegExpReplace($txt, "(?m)^\s*$\R?", "") ?
    2 points
  4. This one also corrects the capitalization of 'line' while we are being all needy ConsoleWrite(stringreplace(StringStripWS(StringReplace(StringStripCR(FileRead("txt.txt")) , @LF & @LF , @CRLF) , 4) , @LF & "l" , @LF & "L"))
    1 point
  5. Tweaked for the last time #include <StringConstants.au3> Local $s_Delete = InputBox("Enter", "Enter what you want to delete") If @error Then Exit Local $h_FileOpen = FileOpen(@ScriptDir & "\TXT.txt", 2) FileWrite($h_FileOpen, StringRegExpReplace(StringRegExpReplace(StringReplace(FileRead(@ScriptDir & "\OLD\TXTOLD.txt"), $s_Delete, ''), "(?m)^\s*$\R?", ""), '(?m)^\s+|\s+\Z', '')) FileClose($h_FileOpen)
    1 point
  6. another one Local $s = @CRLF & "One" & @CRLF & @CRLF & "Two" & @CRLF & "Three" & @CRLF & @CRLF & _ "Four" & @CRLF & "" & @CRLF & "Five" & @CRLF & "Six" & @CRLF & "" & @CRLF & "" & @CRLF ConsoleWrite( StringRegExpReplace($s, "^\R+|\R+$|\R\K\R+", "") )
    1 point
  7. water

    DSA.MSC

    Why automate the GUI? Use my AD UDF to directly access Active Directory.
    1 point
  8. he will have to try it. In my experience with companies that Use Citrix, especially Health Care, the security dept is overly controlling and blocks everything possible. In my case, applications have to be launched from a local system drive, not from a network location.
    1 point
  9. Using mikell's SRE you could try this $Inputbox = InputBox("Enter", "Enter what you want to delete", "", "") If @error Then Exit Local $s_FileRead = FileRead(@ScriptDir & "\OLD" & "\TXTOLD.txt") Local $h_FileOpen = FileOpen(@ScriptDir & "\" & "TXT.txt", 2) FileWrite($h_FileOpen, StringRegExpReplace(StringReplace($s_FileRead, $Inputbox, ''), "(?m)^\s*$\R?", "")) FileClose($h_FileOpen)
    1 point
  10. Like this? Local $s = @CRLF & "One" & @CRLF & @CRLF & "Two" & @CRLF & "Three" & @CRLF & @CRLF & _ "Four" & @CRLF & "" & @CRLF & "Five" & @CRLF & "Six" & @CRLF & "" & @CRLF & "" & @CRLF ConsoleWrite(StringRegExpReplace($s, "(?m)(\A\R)|(\R(?=\R|\z))", "") & @LF) This regexp removes leading, extra, trailing line breaks.
    1 point
  11. Of course... your code splits the text to an array, and a StringRegExpReplace (or else) will not delete the array elements containing blank/empty lines Just FileRead the txt, apply the SRER to the whole string without splitting, and FileWrite the result
    1 point
  12. thanks! I got the same results with the extra character "[]" and removed it from the output: import socket for IP in open('/root/Desktop/ip.txt').readlines(): try: host = socket.gethostbyaddr(IP.rstrip()) hostname = host[0] print(IP.rstrip(),hostname) except Exception as e: print(IP.rstrip(),"NULL") Output: ('1.1.1.1', 'hostname.domain') ('2.2.2.2', 'hostname.domain')
    1 point
  13. I have worked with Citrix a lot, and it's a giant PITA. You won't be able to interact with it from outside, so if your using Citrix Desktops, you have to write your script & run your script from inside a citrix session. If your launching a published app, your pretty much out of luck, unless you can convince your Citrix team to turn your script into a published app.
    1 point
  14. You have to activate anti aliasing. #include <GDIPlus.au3> Text2PNG(@DesktopDir & "\MyPNG.png", 0x00FFFFFF) ; Transparent but bold ugly text ;Text2PNG(@DesktopDir & "\MyPNG.png", 0xFFFFFFFF) ; Nice Text but not transparent Func Text2PNG($sFile, $iColor) _GDIPlus_Startup() Local $hImage = _GDIPlus_BitmapCreateFromScan0(50, 25) Local $hGraphics = _GDIPlus_ImageGetGraphicsContext($hImage) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetTextRenderingHint($hGraphics, $GDIP_TEXTRENDERINGHINT_ANTIALIAS) _GDIPlus_GraphicsClear($hGraphics, $iColor) _GDIPlus_GraphicsDrawString($hGraphics, "Hello", 0, 0, "Arial", 12, 0) _GDIPlus_ImageSaveToFile($hImage, $sFile) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_BitmapDispose($hImage) _GDIPlus_Shutdown() EndFunc ;==>Text2PNG
    1 point
  15. Close...here is a way to limit the div's you select....you can also instead get all the child elements, and loop through those... $oDiv = _IEGetObjById($oIE,"past-queue-wrapper") $oChildDivs = _IETagNameAllGetCollection($oDiv,"div") For $oChildDiv In $oChildDivs ConsoleWrite($oChildDiv.classname & @TAB & $ochilddiv.id & @CRLF) Next
    1 point
  16. jdelaney

    Winactive Regexp

    Edit: syntax error: #include <Array.au3> $a = WinList("[REGEXPTITLE:\A[a|b|c|d|e|f]]") _ArrayDisplay($a) Assuming you mean that the starting character can be a, b, c, d, e, or f....correct? Otherwise, this works...if it's just a string: AutoItSetOption("WinTitleMatchMode",1) ; this is not necessary, as 1 is the default...unless you have changed this setting earlier in your script. WinActivate("abcdef")
    1 point
  17. or this one msgbox(0, '' , StringReplace(StringStripCR(FileRead("txt.txt")) , @LF & @LF , ""))
    1 point
  18. Have you reviewed this thread?
    1 point
  19. StringReplace(StringReplace(StringReplace($sFile , @CRLF , "|") , "||" , "") , "|" , @CRLF)) ?! also with a flurry of array funcs? #include<array.au3> $arr = FileReadToArray("test.txt") _ArrayDelete($arr , _ArrayToString(_ArrayFindAll($arr , "") , ";")) _ArrayDisplay($arr)
    1 point
  20. Read the file to an array using FileReadToArray Remove the duplicates with _ArrayUnique Then process the array returned by _ArrayUnique to do what you want with the links
    1 point
  21. The flag you used with StringStripWS will remove all spaces in the text. This works OK for the example you posted but if the line you want to keep has spaces between the words like, "I have spaces", it will become "Ihavespaces" when written to the file
    1 point
  22. Search here for associative array, or scripting.dictionary.
    1 point
  23. this reproduced the error for me and you are correct, it is hanging at controlsend. did not realize that my act of changing focus was the reason the script was finishing for me.
    1 point
  24. Melba23

    screenshot region

    hendrikhe, Here are 2 fairly old scripts from my Snippets folder - I have posted them before several times. The first marks a red rectangle, while the second creates a transparent rectangle, the contents of which are stored in a file and then displayed: Please ask if you have any questions. M23
    1 point
  25. Like this: Func Uninstall() ;delete all you files here Local $s_RemoveBat = @TempDir & "\remove.bat" Local $h_RemoveBat = FileOpen($s_RemoveBat, 2) FileWrite($h_RemoveBat, ":start" & @CRLF & 'del "' & @AutoItExe & '"' & @CRLF & 'IF EXIST "' & @AutoItExe & '" goto start' & @CRLF & 'del "' & $s_RemoveBat & '"') FileClose($h_RemoveBat) Run($s_RemoveBat, "", @SW_HIDE) EndFunc
    1 point
×
×
  • Create New...