Posts

Showing posts with the label autohotkey

How to replace text followed by a comma (,) or dot (.) in tab delimited file (txt)?

How to replace text followed by a comma (,) or dot (.) in tab delimited file (txt)? I am new to autohotkey. I have a script which helps me to shorten those words that I don't need, and I am having a problem when trying to replace text that followed by a comma or a dot, Here is my script: #NoEnv #SingleInstance force SetWorkingDir, %A_ScriptDir% SendMode, Input ; -- Ctrl + SPACE -> Select all text + replace whole words only + title case ^SPACE:: NonCapitalized := "a|an|in|is|of|the|this|with" ; List of words that shouldn't be capitalized, separated by pipes ReplacementsFile := "replacements.txt" ; Path to replacements file (tab delimited file with 2 columns, UTF-8-BOM, CR+LF) Send, ^a ; Selects all text Gosub, SelectToClip ; Copies the selected text to the clipboard FileRead, Replacements, % ReplacementsFile ; Reads the replacements file If ErrorLevel ; Error message if file is not found { MsgBox, % "File not found: " ReplacementsFile...