How to trim extra space when selecting text?
I'll try over the weekend.
How about his? Notepad Format/WordWrap must be set to off.
Code: Select all
filename:="words.txt"
delimiter:=";"
Send, ^c
Sleep, 200
word=%clipboard%
FileRead, OUT, %filename%
found:=0
Loop, Parse, OUT, `n, `r
{
if A_LoopField contains %word%%delimiter%
{
StringSplit, COL, A_LoopField, %delimiter%
if not COL2
{
Run notepad %filename%
WinWaitActive, ahk_class Notepad
Send, ^g%A_Index%{Enter}^+{Right}
}
else
Msgbox, 64,, % COL1 "`n`n" COL2
found:=1
break
}
}
if not found
{
FileAppend, `n%word%%delimiter%, %filename%, UTF-8
Run notepad %filename%
WinWaitActive, ahk_class Notepad
Send, ^{End}
}
return
Hi Tom,
I was on vacation. Thank you very much for the code. It works flawlessly!
I was on vacation. Thank you very much for the code. It works flawlessly!
Dear Tom,
I hope you are doing well. It has been a long time, and now I started working with a new language, Norwegian. It has different characters, and I found problems with the code. For example, "spørsmål" is read as "spørsmÃ¥l." But more importantly, the script does not detect words already in the file that has Norwegian characters such as ø,æ, and å. It acts as though the file does not have the word. I did a little research and discovered the problems have to do with utf-8 and character-encoding, but could not successfully edit the code. I would be grateful if you could support me on this.
I look forward to hearing from you.
I hope you are doing well. It has been a long time, and now I started working with a new language, Norwegian. It has different characters, and I found problems with the code. For example, "spørsmål" is read as "spørsmÃ¥l." But more importantly, the script does not detect words already in the file that has Norwegian characters such as ø,æ, and å. It acts as though the file does not have the word. I did a little research and discovered the problems have to do with utf-8 and character-encoding, but could not successfully edit the code. I would be grateful if you could support me on this.
I look forward to hearing from you.
Hi, try to open your txt file in Notepad and save it with UTF-8 encoding.
Hi,
Thank you very much for the reply.
I did but the problem is still there. The script does not work with words that have ø, å, æ. It ignores these words already in the file and creates a new entry for them at the end of the text. The file: https://drive.google.com/file/d/16ubROt ... sp=sharing
I appreciate your support.
Thank you very much for the reply.
I did but the problem is still there. The script does not work with words that have ø, å, æ. It ignores these words already in the file and creates a new entry for them at the end of the text. The file: https://drive.google.com/file/d/16ubROt ... sp=sharing
I appreciate your support.