Jump to content
wzc0014

Select string of text between quotes

Recommended Posts

Hello, 

I am interested in looking at a chunk of text, selecting the string that is in quotes, and copying it to the clipboard. It will always have quotes at the beginning and end, start with https:// and will always contain .mp3 . But everything else is pretty random. This is an example of a piece of text

Quote

 

suhfiushifuhrifuei file: "https://d1gwazgugjenv6.net/after/bef0re/062316.mp3?Expires=1470376621&Signature=h06vK9xR0mbXaMPKO0eQpBSUJX6hvK7l~AgQgCRMcd6DPJmbuMNOaD8P52pnvaGYrQUZUjBUlTfxXACtGyzgP-AdJZkcUlprGUtL47PAqLeiuu-JEomk2Y13qRB7eWjVVl3v0CfjXvgxQXVlwNob2HrmglVFKkusSJRdOTjuwAAZP89Pf~l3w2p6RFy9gL3E1nq3DQowa9NGIQYEdExLPDOYu5jLPI5lhuH8t8vTAZRCwq6YuJtIQ5vJgrQHkk4q7aECn8T8pGvwmossGjrcz-Ga0KlZiefBwFe7XXV66Xor5SVPkaoN3DTQ07ZuAqEtV5ccd6PyOM0iVLFfYjw__&Key-Pair-Id=APKAJ5GT74YAYAGA4KAA",   APKAJ5GT74YAYAGA4KAA


 

I tried doing something like this but it didn't like the quotes. 

$sStart = "file: ""
$sEnd = "","
$aExtract = _StringBetween($sStart, $sEnd)
ClipPut($aExtract)

 

Or is there a better/easier way to do this?

Share this post


Link to post
Share on other sites

Working with quotes in a string can get hairy fast and _StringBetween returns an array, try this code and see if it doesn't help...

#include <Array.au3>
#include <String.au3>
$string = 'suhfiushifuhrifuei file: "https://d1gwazgugjenv6.net/after/bef0re/062316.mp3?Expires=1470376621&Signature=h06vK9xR0mbXaMPKO0eQpBSUJX6hvK7l~AgQgCRMcd6DPJmbuMNOaD8P52pnvaGYrQUZUjBUlTfxXACtGyzgP-AdJZkcUlprGUtL47PAqLeiuu-JEomk2Y13qRB7eWjVVl3v0CfjXvgxQXVlwNob2HrmglVFKkusSJRdOTjuwAAZP89Pf~l3w2p6RFy9gL3E1nq3DQowa9NGIQYEdExLPDOYu5jLPI5lhuH8t8vTAZRCwq6YuJtIQ5vJgrQHkk4q7aECn8T8pGvwmossGjrcz-Ga0KlZiefBwFe7XXV66Xor5SVPkaoN3DTQ07ZuAqEtV5ccd6PyOM0iVLFfYjw__&Key-Pair-Id=APKAJ5GT74YAYAGA4KAA",   APKAJ5GT74YAYAGA4KAA'
$sStart = 'file: "'
$sEnd = '",'
$aExtract = _StringBetween($string, $sStart, $sEnd)
;ClipPut($aExtract)
_ArrayDisplay($aExtract)

 

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

  • Similar Content

    • By junichironakashima
      I have a windows 10 pc and Im trying to create an automatic solving in calculator with a simple worded question (example: What is 45 x 53 ?). thou I cant make the select...Case...EndSelect statement work, here is my code
      #include <AutoItConstants.au3> HotKeySet("{F4}", "ExitProg") Func ExitProg() Exit 0 EndFunc MouseClick($MOUSE_CLICK_LEFT, 417, 659, 2, 1) Send("^c") Func valData() $Chek = "What " If ClipGet() == $Chek Then Check() Else Do MouseClick($MOUSE_CLICK_LEFT, 417, 659, 2, 3) Send("^c") Sleep(500) Until ClipGet() == $Chek EndIf EndFunc Func Check() $Chek2 = "?" c1() c2() c3() c4() c5() c6() c7() Select Case c1() = $Chek2 ;two MouseClick($MOUSE_CLICK_LEFT, 453, 645, 2, 1) Send("^c") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 1347, 197, 1, 1) Send("^v") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 474, 645, 2, 1) Send("^c") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 1347, 197, 1, 1) Send("*") Send("^v") Send("{NUMPADENTER}") Case c2() = $Chek2 ;three MouseClick($MOUSE_CLICK_LEFT, 453, 645, 2, 1) Send("^c") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 1347, 197, 1, 1) Send("^v") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 482, 645, 2, 1) Send("^c") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 1347, 197, 1, 1) Send("*") Send("^v") Send("{NUMPADENTER}") Case c3() = $Chek2 ;four MouseClick($MOUSE_CLICK_LEFT, 453, 645, 2, 1) Send("^c") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 1347, 197, 1, 1) Send("^v") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 487, 645, 2, 1) Send("^c") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 1347, 197, 1, 1) Send("*") Send("^v") Send("{NUMPADENTER}") Case c4() = $Chek2 ;five MouseClick($MOUSE_CLICK_LEFT, 453, 645, 2, 1) Send("^c") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 1347, 197, 1, 1) Send("^v") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 495, 645, 2, 1) Send("^c") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 1347, 197, 1, 1) Send("*") Send("^v") Send("{NUMPADENTER}") Case c5() = $Chek2 ;six MouseClick($MOUSE_CLICK_LEFT, 453, 645, 2, 1) Send("^c") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 1347, 197, 1, 1) Send("^v") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 495, 645, 2, 1) Send("^c") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 1347, 197, 1, 1) Send("*") Send("^v") Send("{NUMPADENTER}") Case c6() = $Chek2 ;seven MouseClick($MOUSE_CLICK_LEFT, 453, 645, 2, 1) Send("^c") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 1347, 197, 1, 1) Send("^v") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 509, 645, 2, 1) Send("^c") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 1347, 197, 1, 1) Send("*") Send("^v") Send("{NUMPADENTER}") Case c7() = $Chek2 ;eight MouseClick($MOUSE_CLICK_LEFT, 453, 645, 2, 1) Send("^c") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 1347, 197, 1, 1) Send("^v") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 509, 645, 2, 1) Send("^c") Sleep(150) MouseClick($MOUSE_CLICK_LEFT, 1347, 197, 1, 1) Send("*") Send("^v") Send("{NUMPADENTER}") Case Else Exit EndSelect EndFunc Func c1() MouseClick($MOUSE_CLICK_LEFT, 485, 643, 2, 1) Send("^c") EndFunc Func c2() MouseClick($MOUSE_CLICK_LEFT, 493, 644, 2, 1) Send("^c") EndFunc Func c3() MouseClick($MOUSE_CLICK_LEFT, 498, 645, 2, 1) Send("^c") EndFunc Func c4() MouseClick($MOUSE_CLICK_LEFT, 508, 647, 2, 1) Send("^c") EndFunc Func c5() MouseClick($MOUSE_CLICK_LEFT, 514, 645, 2, 1) Send("^c") EndFunc Func c6() MouseClick($MOUSE_CLICK_LEFT, 523, 645, 2, 1) Send("^c") EndFunc Func c7() MouseClick($MOUSE_CLICK_LEFT, 530, 645, 2, 1) Send("^c") EndFunc valData() MouseClick($MOUSE_CLICK_LEFT, 1349, 196, 1, 1) ;clicking the answer in calc Send("^c") Send("{DEL}") MouseClick($MOUSE_CLICK_LEFT, 499, 706, 1, 1) Send("^v") Exit  
    • By _leo_
      Hey there!
      I am having a problem with clicking a button in IE. As you can see in the code, there would be a class name to click it, but since this button exists several times with exactly the same code, I can only use the "Noch nicht veröffentlicht" to separate it from the others. But this part is just pure text without any classification. 
      "<div class="checkmark" data-v-1e5b1f70=""><svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 16 16" data-v-1e5b1f70=""><circle cx="8" cy="8" r="8" data-v-1e5b1f70="" /></svg></div>Noch nicht veröffentlicht"
      I was trying to click it with:
      #include <IE.au3> local $oNNVs = _IEFormGetCollection($oIE2) For $oNNV in $oNNVs If String($oNNV.innertext) = "Noch nicht veröffentlicht" Then _IEAction($oNNV, "click") EndIf Next and:
      $inputs = $oIE2.document.getElementsByTagName("div") For $input In $inputs If $input.innertext == "Noch nicht veröffentlicht" then $input.click() EndIf Next But nothing seems to work. Thanks for the help!
    • By GillesMaisonneuve
      Good morning,
       
      I am trying to align a two-line text in a button so that it would be centered in the button but can't succeed to do it for the vertical part.
      Can someone tell me what I do wrong ?
      Here is my code:
      $btn3 = GUICtrlCreateButton("Execute " & @LF & " file 1", 100, 65, 60, 50, _ BitOr($BS_CENTER,$BS_BOTTOM,$BS_MULTILINE)) and here is the resulting layout I get in my window.
      I tried to follow the help, made a lot of different parameter combinations (here it's `$BS_BOTTOM`, but I tried `$BS_VCENTER` and `$BS_TOP`), still get the same result : vertical alignement is a no go for me.
      Can someone help ?
      TIA
      Gilles

    • By dascondor
      So basically need to pull text from a .txt file or .sql and use that text to replace something within a different file.
       
      First File:
      jumps
       
      Or:
      Text1 = jumps
      Text2 = fence
      Second File:
      My Dog XXXXX over the YYYYY.
       
       
      After Script:
      My Dog jumps over the fence
       
      I have found a good start, I'm basic programmer at best, I have some experience but this gets out of my wheel house.
       
      Any help is appreciated.
       
       
    • By misioooo
      Hi!
       
      I am writing some GUI and i need to use images as buttons, but with text on them (text is from INI file).
      Part with button looks like this:
      $ankieta1 = GUICtrlCreateButton($txtAnk1, 100,350,765,164) GUICtrlSetFont(-1, 22, 800, -1, "Arial") ;GUICtrlSetColor(-1,0xffffff) $hImageBtn_1 = _GUIImageList_Create(765, 164) _GUIImageList_AddBitmap($hImageBtn_1, "c:\path\to\ankieta_clean.bmp") _GUICtrlButton_SetImageList($ankieta1, $hImageBtn_1, 4) GUICtrlSetOnEvent(-1, "On_Ankieta1") The problem - if i uncomment GUICtrlSetColor, color of text changes, but button is just plain gray (no image). How i can change text color not touching image on a button here?
×
×
  • Create New...