While it is easy to use Excel to transpose rows into columns, I’ve created an AutoHotkey script which negates the need to. Basically it examines what is on the clipboard and replaces tabs with line breaks, then it sends paste to the program thus it is transposing clipboard content. I have it triggered of hitting a hotkey and comes in pretty handy and can save some time if it is something you do frequently.
Below is a video which demonstrates it usage.
^+t:: ;Control, Shift and T trigger script
StringReplace, clipboard, clipboard,%A_Tab%, `r , All ;replace all tabs with line return
SendPlay,^v ;send "paste"
Return
It always amazes me of how frequently I have to manipulate text I in various ways. More often than not it is simply doing a SciTEfind and replace but being able to have other ways to manipulate text is also a great time saver!
In this video I walk through some of the tips & tricks of using SciTE search and replace text within the text editor. I also demonstrate one of the “coolest” features which is block / typing across multiple lines. This is a GREAT feature which many do not know how to use. The Regular Expressions and dealing with line returns / new lines are also very helpful.
In the video I also showed how I updated my AutoHotKey SciteUser.properties file. Below is the line I added #### Changing SciTE Find and Replace to posix regular expression mode so do not have to escape parens find.replace.regexp.posix=1
To avoid having to escape parens (watch above video) add the following in your SciTE user.properties file. If set to 0, syntax uses the old Unix style where \( and \) mark capturing sections while ( and ) are themselves. If set to 1, syntax uses the more common style where ( and ) mark capturing sections while \( and \) are plain parentheses.
Here are some useful POSIX terms which are more readable in your SciTE Find and Replace
[:xxx:] were xxx is one of the following words: NAMEDESCRIPTION alnum letters and digits alpha letters word “word” characters (like \w) digit decimal digits (like \d) space white space punct printing characters, excluding letters and digits lower lower case letters upper upper case letters
I used to work in Market Research and would spend hours cleaning up labels from surveys I’d programmed in online tools. The below video shows how easy it can be if you understand regular expressions and a little programming.
Regular Expressions can have a steep learning curve however it is really worth it if you continually get data that you need to clean. You can also check out this post of mine showing how they can be used to automate your metrics.
RegEx to clean text demo
A handy cheat-sheet is downloadable from here and a wonderful course from Kevin Skoglund available from Lynda.com is available here. Below is a great intro to the Regular Expressions.
Jan 25, 2014 … … a question; Anybody can answer; The best answers are voted up and rise to the top. Regex to clean string in preparation for word count in PHP …
Apr 7, 2015 …Regular expressions to clean text in preparation for word count in PHP · 0 · Remove parameters from string containing URL · 4 · Normalizing strings using …
Aug 21, 2013 …Regex to clean text in preparation for word count in PHP · 2 · Regex-ing an array · 2 · Removing stray brackets from in between shortcodes.