regular expressions tutorial
Started by jimspoon
on 9/10/2014
jimspoon
9/10/2014 10:32 pm
I've been consolidating my journal entries into a single Excel spreadsheet, and now I have well over 100,000 entries going back to 2002. Each journal entry begins with a timestamp in the format - "2014.09.10.1541 -"
anyway it has taken quite a bit of doing to break up the entries into smaller entries and put the timestamp at the front of each one.
I was able to accomplish a lot in Notepad++ (freebie) using seach and replace using regular expressions. The process has been an eye-opener for me on the power of regular expressions. Also Excel helps a lot particularly with converting dates from one text format to another.
I just wanted to pass along a link to a good regex tutorial -
http://gnosis.cx/publish/programming/regular_expressions.html
anyway it has taken quite a bit of doing to break up the entries into smaller entries and put the timestamp at the front of each one.
I was able to accomplish a lot in Notepad++ (freebie) using seach and replace using regular expressions. The process has been an eye-opener for me on the power of regular expressions. Also Excel helps a lot particularly with converting dates from one text format to another.
I just wanted to pass along a link to a good regex tutorial -
http://gnosis.cx/publish/programming/regular_expressions.html
Slartibartfarst
9/11/2014 7:29 am
Thanks Jim - the Regex tutorial will come in handy for me, as a revision tool.
On your moving all your journal entries into Excel, I have to ask, "Why?"
On your moving all your journal entries into Excel, I have to ask, "Why?"
jimspoon
9/11/2014 2:26 pm
Slartibartfarst wrote:
Primarily for purposes of altering the data before I copy the items into Infoqube. With all its functions, etc., Excel is quite good for this purpose. And I'm not even using macros yet. Unfortunately Excel does not support search and replace using regular expressions, that would make it even more powerful. OpenOffice Calc does do this, but I haven't tried it yet for this purpose.
Excel is also very useful for filtering a large number of text items - filtering for text contained within the items using the "contains" option. Even when the spreadsheet contains hundreds of thousands of items, it is very very fast. (Excel supports up to 1,048,576 rows x 16,384 columns.) Much faster than OpenOffice Calc for this purpose. I am thinking of making greater use of Excel for note-taking, even if just as a secondary means for searching and manipulating my text entries.
back to regular expressions - this website advertises itself as "The Premier website about Regular Expressions" and I think that may be justified:
http://www.regular-expressions.info/
Thanks Jim - the Regex tutorial will come in handy for me, as a revision
tool.
On your moving all your journal entries into Excel, I have to ask,
"Why?"
Primarily for purposes of altering the data before I copy the items into Infoqube. With all its functions, etc., Excel is quite good for this purpose. And I'm not even using macros yet. Unfortunately Excel does not support search and replace using regular expressions, that would make it even more powerful. OpenOffice Calc does do this, but I haven't tried it yet for this purpose.
Excel is also very useful for filtering a large number of text items - filtering for text contained within the items using the "contains" option. Even when the spreadsheet contains hundreds of thousands of items, it is very very fast. (Excel supports up to 1,048,576 rows x 16,384 columns.) Much faster than OpenOffice Calc for this purpose. I am thinking of making greater use of Excel for note-taking, even if just as a secondary means for searching and manipulating my text entries.
back to regular expressions - this website advertises itself as "The Premier website about Regular Expressions" and I think that may be justified:
http://www.regular-expressions.info/
Alexander Deliyannis
9/11/2014 3:17 pm
Regular expressions are indeed very powerful. I usually employ them in one of my main editors, EmEditor.
But I admit that I am rather lazy to actually learn them, so I resort to 'cheatting' with the help of RegEx Buddy http://www.just-great-software.com/
But I admit that I am rather lazy to actually learn them, so I resort to 'cheatting' with the help of RegEx Buddy http://www.just-great-software.com/
CRC
9/11/2014 4:42 pm
I second the recommendation on RegEx Buddy.
jimspoon
9/11/2014 5:45 pm
The author of regexbuddy is the author of the regex reference site - http://www.regular-expressions.info/
I wish it were a lot cheaper, $40 seems a lot for such a tool. :(
i think i'll have a look at some of the alternatives listed here --
http://alternativeto.net/software/regexbuddy/
I wish it were a lot cheaper, $40 seems a lot for such a tool. :(
i think i'll have a look at some of the alternatives listed here --
http://alternativeto.net/software/regexbuddy/
Prion
9/12/2014 12:05 pm
If you are using regex as a Mac user, there are two good alternatives that I am aware of:
Oyster
Patterns
HTH
Oyster
Patterns
HTH
Alexander Deliyannis
9/12/2014 1:53 pm
You can consider part of the programme cost as a fee for accessing the website.
Seriously now, I have no afiliation with the developer, but am impressed by the background work supporting RegEx Buddy. E.g., I was not aware that there are tens of variations of RegEx depending on the programming environment; RegEx Buddy can adjust to just about any such variation.
Seriously now, I have no afiliation with the developer, but am impressed by the background work supporting RegEx Buddy. E.g., I was not aware that there are tens of variations of RegEx depending on the programming environment; RegEx Buddy can adjust to just about any such variation.
