Search found 99 matches

by Wigi
11 Nov 2019, 14:37
Forum: Ask For Help
Topic: Regular expression is not working
Replies: 9
Views: 238

Re: Regular expression is not working

In my case (and for my text file), all 3 solutions return the 2 matches. While Pos := RegExMatch(Text_of_vars, "(?<=\v)\s*?\w+?\s*?=", m, Pos+StrLen(m)) While Pos := RegExMatch(Text_of_vars, "m)^\s*?\w+?\s*?=", m, Pos+StrLen(m)) While Pos := RegExMatch(Text_of_vars, "\v\s*?\w+?\s*?=", m, Pos+StrLen(...
by Wigi
11 Nov 2019, 14:26
Forum: Ask For Help
Topic: Regular expression is not working
Replies: 9
Views: 238

Re: Regular expression is not working

So it is !
I was using hardcoded text for testing and debugging, then I moved back to the text file contents.

Many thanks, I will test whether the regex can return all cases I would like it to return :-)
by Wigi
11 Nov 2019, 14:24
Forum: Ask For Help
Topic: Regular expression is not working
Replies: 9
Views: 238

Re: Regular expression is not working

Hold on, I will test it first myself. Probably simply changing the variable.
by Wigi
11 Nov 2019, 14:23
Forum: Ask For Help
Topic: Regular expression is not working
Replies: 9
Views: 238

Re: Regular expression is not working

Thank you ! Last question. My haystack is actually a part of a (small) text file. So I have the variable "FileContents" containing the haystack. This works. As I understand it, that text has some problem with LF vs CRLF. How would it change your code if a variable is used instead of hardcoded text p...
by Wigi
11 Nov 2019, 14:10
Forum: Ask For Help
Topic: Regular expression is not working
Replies: 9
Views: 238

Re: Regular expression is not working

Thanks. I want to filter out all 'variable assignments'. That is: - a new line - whitespace (if wanted) - text (the name of the variable) - whitespace (if wanted) - an equal sign The example is simplified but even then I could not get it to work. What if I want to use ^ to make sure I have the begin...
by Wigi
11 Nov 2019, 13:42
Forum: Ask For Help
Topic: Regular expression is not working
Replies: 9
Views: 238

Regular expression is not working

Hi there, I have this small regex exercise, and it gives me a blank MsgBox. Can someone see what is the issue please ? I confirmed with regex101.com that my regex is returning the correct result. I reused coding from this post: https://autohotkey.com/board/topic/67437-regexmatch-multiple-matches/#en...
by Wigi
30 Jul 2019, 11:10
Forum: Ask For Help
Topic: Userform for picking a file and a folder, and other simple controls
Replies: 3
Views: 270

Re: Userform for picking a file and a folder, and other simple controls

Amazing, it works and I will be able to use this. Afterwards post my final code here. The script creates a shortcut to an executable (TM1s.exe for the IBM Cognos TM1 software). By doing so, a number of choices must be made, like selecting a folder for the model (cubes, ...) and a folder for logging ...
by Wigi
30 Jul 2019, 08:36
Forum: Ask For Help
Topic: Userform for picking a file and a folder, and other simple controls
Replies: 3
Views: 270

Re: Userform for picking a file and a folder, and other simple controls

Thank you very much, I will check it out after work.
by Wigi
30 Jul 2019, 04:54
Forum: Ask For Help
Topic: Userform for picking a file and a folder, and other simple controls
Replies: 3
Views: 270

Userform for picking a file and a folder, and other simple controls

Hello all, Hope you're having a good day ! I have written my own AHK scripts, in total 3,000 lines of code, so I already know how to do it :-) Yet, I did not create a userform. I would like to replace an AHK routine with: - FileSelectFolder - inputbox - msgbox to the same routine but based on 1 user...
by Wigi
28 May 2019, 19:48
Forum: Ask For Help
Topic: Remove blank lines from text file Topic is solved
Replies: 23
Views: 1654

Re: Remove blank lines from text file Topic is solved

Hello Joe,

Jep, bingo ! Thanks.

Wim
by Wigi
28 May 2019, 18:49
Forum: Ask For Help
Topic: Remove blank lines from text file Topic is solved
Replies: 23
Views: 1654

Re: Remove blank lines from text file Topic is solved

Hello Joe,

I have an update for you. I simplified the input file that we start from (left hand side), right hand side is the result. You'll notice that empty lines still remain in the output unfortunately. I show the end of line characters in case it helps.
01.png
01.png (119.03 KiB) Viewed 344 times
Thanks,

Wim
by Wigi
26 May 2019, 20:16
Forum: Ask For Help
Topic: Remove blank lines from text file Topic is solved
Replies: 23
Views: 1654

Re: Remove blank lines from text file Topic is solved

Hello

Busy Sunday, I’ll catch up on Monday.
by Wigi
26 May 2019, 00:50
Forum: Ask For Help
Topic: Remove blank lines from text file Topic is solved
Replies: 23
Views: 1654

Re: Remove blank lines from text file Topic is solved

I can't get it to work. I also changed in the original file the CRLF by CR. Does not work. Changed CRLF by LF, no joy either. Could it be due to the IF test: If ((tmp!="#" ) and (tmp!="")) whereby: Loop, Read, %c01% splits the text in a different way ? Such that the lines are not really empty ? I lo...
by Wigi
26 May 2019, 00:29
Forum: Ask For Help
Topic: Remove blank lines from text file Topic is solved
Replies: 23
Views: 1654

Re: Remove blank lines from text file Topic is solved

No luck Joe, the same output is produced.
by Wigi
25 May 2019, 18:31
Forum: Ask For Help
Topic: Remove blank lines from text file Topic is solved
Replies: 23
Views: 1654

Re: Remove blank lines from text file Topic is solved

Thanks, that’s for tomorrow. 1.30 AM here 😉
by Wigi
25 May 2019, 18:11
Forum: Ask For Help
Topic: Remove blank lines from text file Topic is solved
Replies: 23
Views: 1654

Re: Remove blank lines from text file Topic is solved

If you would like to see my full code, here it is. The idea is to create or manipulate the TM1s.cfg configuration file for the IBM Cognos TM1 software. The user can interact to select folders, which are then set in the file. If the cfg file does not exist, it is created. Next to creating / updating ...
by Wigi
25 May 2019, 18:05
Forum: Ask For Help
Topic: Remove blank lines from text file Topic is solved
Replies: 23
Views: 1654

Re: Remove blank lines from text file Topic is solved

Hello Joe, Sorry but it does not work. I have this code: ; 16. delete unnecessary lines Msgbox, 4, Confirm, Do you want to delete all lines in the tm1s.cfg file that start with an # or are blank/empty? IfMsgBox Yes { all = Loop, Read, %c01% { StringLeft, tmp, A_LoopReadLine, 1 If ((tmp!="#" ) and (t...
by Wigi
25 May 2019, 15:05
Forum: Ask For Help
Topic: Remove blank lines from text file Topic is solved
Replies: 23
Views: 1654

Re: Remove blank lines from text file Topic is solved

Thank you Joe. I will come back to this later today.
by Wigi
25 May 2019, 14:00
Forum: Ask For Help
Topic: Remove blank lines from text file Topic is solved
Replies: 23
Views: 1654

Re: Remove blank lines from text file Topic is solved

Sure Joe. I believe you, it might be something here in the file or a mistake when testing, we'll find out. This is the current code: ; 16. delete unnecessary lines Msgbox, 4, Confirm, Do you want to delete all lines in the tm1s.cfg file that start with an # or are blank/empty? IfMsgBox Yes { all = L...
by Wigi
25 May 2019, 13:17
Forum: Ask For Help
Topic: Remove blank lines from text file Topic is solved
Replies: 23
Views: 1654

Re: Remove blank lines from text file Topic is solved

Thank you garry, it works.

Thank you joe too, but it does not seem to work.
If you would like to investigate more, I can send the file and/or a screenshot of both the code and the cfg file I am working on.

Go to advanced search