Inhalt aus einer Variablen/Clipboard auslesen/filtern

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Inhalt aus einer Variablen/Clipboard auslesen/filtern

Re: Inhalt aus einer Variablen/Clipboard auslesen/filtern

Post by garry » 10 Nov 2020, 10:05

@just me danke , dies ist sehr kurz, nur mit regex ....

Re: Inhalt aus einer Variablen/Clipboard auslesen/filtern

Post by just me » 10 Nov 2020, 06:03

@garry,

vielleicht aus so:

Code: Select all

#NoEnv
Str := "
(
654321
jasdfjsöl afdasdf 12345 asdfasjl ahsdfö
jasdfjsöl afdasdf 097654 asdfasjl ahsdf
jasdfjsöl afdasdf 001122 asdfasjl 123456 ahsd
654321
)"
;....
MsgBox, % RegExReplace(Str, "s).*?\b(\d{6})\b\D*", "$1`r`n")

Re: Inhalt aus einer Variablen/Clipboard auslesen/filtern

Post by garry » 09 Nov 2020, 15:53

@KHA , vielen Dank für die Lösung

Re: Inhalt aus einer Variablen/Clipboard auslesen/filtern

Post by KHA » 09 Nov 2020, 13:29

Hallo @garry ,
z.B.

Code: Select all

Str=
(
jasdfjsöl afdasdf 12345 asdfasjl ahsdfö
jasdfjsöl afdasdf 097654 asdfasjl ahsdf
jasdfjsöl afdasdf 001122 asdfasjl 123456 ahsd
)

Pos := 1

While Pos := RegExMatch(Str, "(\d{6})",  Zahl, StrLen(Zahl) + Pos)
{
	if (Zahl1 != "")
	AlleZahlen .= Zahl1 . "`r`n"

}
MsgBox, % AlleZahlen

Re: Inhalt aus einer Variablen/Clipboard auslesen/filtern

Post by garry » 09 Nov 2020, 12:18

@KHA , danke , wie kann man's lösen wenn im Text mehrere 6-stelligen Zahlen gesucht werden ? ( Ergebnis getrennt mit `r`n )

Code: Select all

str=
(
jasdfjsöl afdasdf 12345 asdfasjl ahsdfö
jasdfjsöl afdasdf 097654 asdfasjl ahsdf
jasdfjsöl afdasdf 001122 asdfasjl 123456 ahsd
)
;....

Re: Inhalt aus einer Variablen/Clipboard auslesen/filtern

Post by KHA » 09 Nov 2020, 10:02

Versuch mal so:

Code: Select all

Str := "jasdfjsöl afdasdf 123456 asdfasjl ahsdfö"
RegExMatch(Str, "(\d{6})", Zahl)
MsgBox, % Clipboard := Zahl1

Inhalt aus einer Variablen/Clipboard auslesen/filtern

Post by W8ne3 » 09 Nov 2020, 08:49

Hallo Zusammen,

wie kann ich einen bestimmten Inhalt aus einem markierten Text herausgefiltert wird.
Ein Textfeld beinhaltet einen Text. Dieser wird markiert und kopiert. Dieser Text enthält eine sechsstellige Zahl. Diese würde ich gerne automatisch beim drücken eines Hotkeys in den Clipboard ausgeben.

Beispiel:
jasdfjsöl afdasdf 123456 asdfasjl ahsdfö

Dieser Text wird kopiert. Nach drücken des hotkeys soll nur die Zahl in den Clipboard übergeben werden.

Hat hierfür jemand ein Skript?

Danke

Top