Search found 327 matches

by hagchr
Sat Dec 26, 2020 7:59 pm
Forum: Technical / Scripting
Topic: Consume a result
Replies: 11
Views: 5415

Re: Consume a result

If I adjust your script and add the number 2 to Using then...

Code: Select all

let>Using=24:36:2:
let>MyList=50;8;24;16;2;5;51;

Let>CompareStrings=%Using%%MyList%
StringReplace>CompareStrings,:,;,CompareStrings
RegEx>\b(\d\d?);(?!.*\b\1\b),CompareStrings,0,match,nom,1,,Results
MDL>Results
by hagchr
Sat Dec 26, 2020 7:54 pm
Forum: Technical / Scripting
Topic: Consume a result
Replies: 11
Views: 5415

Re: Consume a result

Hi again, In your previous example, $Base includes all numbers that do not have a duplicate, as well as all duplicates. So really you want everything except $Base. I think the correct way to refer to a named group in the replacement field would be $<Base> not $Base, so I think $Base is wrong syntax ...
by hagchr
Sat Dec 26, 2020 10:06 am
Forum: Technical / Scripting
Topic: Consume a result
Replies: 11
Views: 5415

Re: Consume a result

Hi again, Great that it works and all the best for 2021! The story could have ended here if it wasn't for curious-me. Looking at your final pattern I see you first match/find all numbers that do not have a duplicate, as well as all extra duplicates (smart!). Then you replace the result with $Base gi...
by hagchr
Fri Dec 25, 2020 3:44 pm
Forum: Technical / Scripting
Topic: Consume a result
Replies: 11
Views: 5415

Re: Consume a result

Hi! Nice to see someone interested in Regex - your best friend and your worst enemy. If I understand it correctly you just want to remove duplicates. You can do this by simply taking the matched numbers and replace them with nothing, ie leave the replacement string empty. Your example without the na...
by hagchr
Sat Dec 19, 2020 5:29 pm
Forum: Technical / Scripting
Topic: Get list of files
Replies: 2
Views: 1631

Re: Get list of files

Hello, If you use ; as delimiter then maybe sth like this:

Code: Select all

GetFileList>C:\Users\Christer\Desktop\*.*,strFileList,;
Let>tmp0=[^;]+\.\d\d\d
RegEx>tmp0,strFileList,0,m,nm,0
i.e. look for non-delimit characters [^;]+ that end w . and three digits.
by hagchr
Sun Jun 07, 2020 5:46 pm
Forum: Technical / Scripting
Topic: UTF-8 edit ini file
Replies: 11
Views: 6119

Re: UTF-8 edit ini file

Good you have a working solution. Not sure if relevant/helps, I played around and note that if I create and save an empty inifile2.ini in Notepad (as UTF-8), then when running your script in MS it looks ok (shows åäö).
by hagchr
Sat Jun 06, 2020 8:31 pm
Forum: Beginners
Topic: Extracting links with numeric value in file name
Replies: 1
Views: 4033

Re: Extracting links with numeric value in file name

Hi, There are different ways to solve it. If there is one link per row then one way could be (required code very short, but added explanation in case you have not worked with RegEx> before): LabelToVar>strInfo,strLinks // Use RegEx> to match strings: // https:// // followed by zero or more character...
by hagchr
Sat May 30, 2020 8:58 am
Forum: Beginners
Topic: Error [HTTP / 1.1 404 Not Found] in chromedriver
Replies: 10
Views: 9640

Re: Error [HTTP / 1.1 404 Not Found] in chromedriver

I suddenly got the same problem today. Following the suggestion, I started ChromeDriver manually (as Administrator), ran the script and it started to work again. Not sure if relevant or not, before running the script I also commented out //Let>CHROMEDRIVER_EXE=c:\chromedriver.exe got a warning, but ...
by hagchr
Fri Jan 24, 2020 1:27 pm
Forum: Technical / Scripting
Topic: Remove blank lines when there are more than one of them
Replies: 10
Views: 6064

Re: Remove blank lines when there are more than one of them

Sometimes I get differences using MS and RegexBuddy, but usually it relates to difference in modifier settings. Top left in RegexBuddy you have different choices for eg, case sensitivity, spacing, dot matches line breaks, etc. In MS, if unsure, it can help to include the modifier in the search patte...
by hagchr
Fri Jan 24, 2020 12:52 pm
Forum: Technical / Scripting
Topic: Remove blank lines when there are more than one of them
Replies: 10
Views: 6064

Re: Remove blank lines when there are more than one of them

From the the Manual:
RegEx is compatible with the Perl 5.10 regular expression syntax using the PCRE library.
by hagchr
Wed Jan 22, 2020 8:40 pm
Forum: Beginners
Topic: Cosine function
Replies: 2
Views: 2654

Re: Cosine function

Hi, According to the manual, the COS function requires the angle to be entered in radians, not degrees, see conversion below:

Code: Select all

Let>val_in_degrees=340
Let>val_in_radians={%val_in_degrees%/360*2*Pi}
Let>result={cos(%val_in_radians%)}
MDL>result
by hagchr
Wed Jan 22, 2020 9:48 am
Forum: Technical / Scripting
Topic: Remove blank lines when there are more than one of them
Replies: 10
Views: 6064

Re: Remove blank lines when there are more than one of them

Hi, just an example how to solve it using Regex> You treat the text as one line and look for two or more consecutive end-of-line-characters (\R in regex language). If found replace with just two of them - %CRLF%. LabelToVar>Text,strText Let>tmp0=(?s)(\R){2,} RegEx>tmp0,strText,0,m,nm,1,%CRLF%%CRLF%,...
by hagchr
Wed Jan 08, 2020 12:09 pm
Forum: Technical / Scripting
Topic: Read checkbox from ini
Replies: 1
Views: 1558

Re: Read checkbox from ini

Hi, Not sure of the State property right now but if you just use SetDialogProperty> to set the Checked property to True/False, and then show the Dialog, it should work. Dialog>Dialog1 object Dialog1: TForm Left = 361 Top = 284 HelpContext = 5000 BorderIcons = [biSystemMenu] ClientHeight = 203 Client...
by hagchr
Sun Nov 24, 2019 7:32 pm
Forum: Technical / Scripting
Topic: RegEx Help
Replies: 4
Views: 2974

Re: RegEx Help

Hello, I have read that MS uses a version (not the latest) of Perl but am not sure about the details. To get blocks incl tokens you can eg use: (?s)/\*.+?\*/ To get blocks w/o tokens you can eg use: /\*\R\K(?s).+?(?=\R\*/) where (?s) turns on single line mode \R matches end of lines \K discards what...
by hagchr
Mon Jul 08, 2019 7:13 pm
Forum: Technical / Scripting
Topic: Return Value Given Code
Replies: 3
Views: 2713

Re: Return Value Given Code

I feared one of those mega sheets with a lots of data which would have "clogged" any array. But if your excel sheet is simple with just the table and not too many rows then I think your solution is better.
Sign up to our newsletter for free automation tips, tricks & discounts