resources:emacs_resources
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| resources:emacs_resources [2015/06/24 10:49] – anthony | resources:emacs_resources [2019/05/22 16:08] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Emacs Resources ====== | ||
| - | + | \\ | |
| - | + | ||
| - | + | ||
| - | < | + | |
| ====== Regular expressions ====== | ====== Regular expressions ====== | ||
| Line 18: | Line 16: | ||
| ===== Recipes ===== | ===== Recipes ===== | ||
| + | \\ | ||
| + | \\ | ||
| - | ==== Replace single spaces after end of sentence with two spaces. ==== | + | ==== Replace single spaces after end of sentence with two spaces |
| + | |||
| + | < | ||
| Type the following: | Type the following: | ||
| Line 29: | Line 31: | ||
| </ | </ | ||
| - | ==== ADC used when writing SPM table report tool ==== | + | \\ |
| + | ---- | ||
| - | (see here: [[internal: | + | ==== Emacs replacement trick ADC used when writing SPM table report tool ==== |
| + | |||
| + | (from [[internal: | ||
| In output file (“taldaemon_i_plus.td.txt” e.g.), AC used emacs regexp (regular expression) to reformat BA's, and just copied a rectangle to get region descriptions: | In output file (“taldaemon_i_plus.td.txt” e.g.), AC used emacs regexp (regular expression) to reformat BA's, and just copied a rectangle to get region descriptions: | ||
| - | Replace | + | <code emacs> |
| + | [M-x] replace-regexp | ||
| + | ^.*Brodmann area.\([0-9]+\).* [RET] | ||
| + | BA\1 [RET] | ||
| + | </ | ||
| - | and then | + | \\ |
| + | ---- | ||
| - | Replace | + | ==== Emacs regexp |
| + | [Originally from Anthony' | ||
| + | To remove all Windows newlines: | ||
| + | < | ||
| + | M-x replace-regexp | ||
| + | C-q C-j RET | ||
| + | RET | ||
| + | </ | ||
| + | |||
| + | To add a newline before heading names, e.g. " | ||
| + | |||
| + | < | ||
| + | M-x replace-regexp | ||
| + | .\. RET | ||
| + | C-q C-j \& RET | ||
| + | </ | ||
| + | |||
| + | \\ | ||
| + | ---- | ||
| + | |||
| + | ==== Add line break (RETURN) to end of all lines ==== | ||
| + | |||
| + | [Put another way: insert spaces, insert empty line in between every line.] | ||
| + | |||
| + | < | ||
| + | M-x replace-regexp | ||
| + | .$[RET] | ||
| + | \& | ||
| + | </ | ||
| + | |||
| + | " | ||
| + | |||
| + | C-q indicates something like " | ||
| + | |||
| + | C-j inserts a line break (a RETURN keypress, but this might not be the most precise description). | ||
| + | |||
| + | \\ | ||
| + | ---- | ||
resources/emacs_resources.1435157354.txt.gz · Last modified: (external edit)
