You are here
Editplus and Regular Expressions
Was converting some excel stock data into csv, and then into mysql insert commands, and needed a quick way to do this.
I've always found Edit Plus to be a handy, light weight text editor.. at once stage in life even using it as my main PHP IDE (use ZDE now though).. However today I found out how to do a really cool regular expression search and replace.. Example below:
Say we had the line of data:
and we wanted it to look like:
INSERT INTO `share_item_history` (`stamp`, `value`, `volume`) VALUES ('2006-08-01',265,87654321);
you could do:
\nINSERT INTO `share_item_history` (`stamp`, `value`, `volume`) VALUES ('
It could be done a lot more elegantly using more regular expressions, but I don't have time right now..
Reference to: http://editplus.info/wiki/Regular_Expressions.