Is it possible to use a script to automate some of Geany's inbuilt editing functions so that I don't have to work through a long file manually driving the find/replace function?
********************************************************************
EDIT : Here is an important more recent note from technosaurus:
Quoted from other thread heretechnosaurus wrote:Just thought I would mention that as of 1.25 geany (released this month) has a checkbox to allow multiline regex or otherwise uses sed-style matching.
********************************************************************
Continued original thread:
I use Geany to edit a bunch of text messages that I copy off my cellphone. First I copy the two data lines out of each backed up text message then I use the "replace" function to help me get rid of some of the extra words/numbers/jargon/formatting etc that accompanies the text message so that I can get down to something tidy and easily readable.
I have learned how to set the "use regular expressions" function in the "replace" menu so now I can search for word strings and insert/delete line feeds, tabs etc but it would be nice to be able to automate this in a script of some sort.
Here is an example of the sort of data formatting I am working with:
Code: Select all
Date:02.06.2015 10.12.35
TEXT:Hey,did you find the 2nd wheel?
Date:02.06.2015 10.14.17
TEXT:Look in the garage
Date:02.06.2015 10.16.00
TEXT:Its definitely there!!
Code: Select all
02.06 10.12.35 Hey,did you find the 2nd wheel?
02.06 10.14.17 Look in the garage
02.06 10.16.00 Its definitely there!!
Code: Select all
Open the Geany 'replace' menu then turn on "Replace all - in document". Next turn on "regular expressions" in the replace dialog and then do the following steps:
1) Replace Date: with \ (\ is the 'regular expression' which means backspace)
2) Replace .2015(followed by space) with \t (\t is the 'regular expression' that means tab)
3) Replace \nTEXT: with \t\t (\n means "the newline or linefeed preceeding TEXT:") (\t\t means double tab)
(Maybe there is a better way than Geany? - sed seems like an appropriate method but I struggle with the level of technical accuracy that sed requires so I do feel more comfortable with Geany at this stage)
Here is the typical 'replace' menu I am using in Geany (with "regular expressions" ticked)
: