lang/awk/ RandomSnippets001


Colon-separated to table

This

pp | tr -d "\r" | awk 'BEGIN { IFS=": " } /#/ { print } !/#/ { print "| " $1 " | " $2 " |" }' | pc

(where pp is a command that pastes from the clipboard, and pc is a command that pastes to the clipboard. I have two scripts which call the appropriate programs based on the operating system and window system in use at the time, e.g. X11 vs Windows vs Cygwin vs Macos) turns this:

### Basic DaVinci Resolve Shortcuts:
Cut: Ctrl/Cmd + X
Copy: Ctrl /Cmd + C
Undo: Ctrl/Cmd + Z
Redo: Ctrl/Cmd + Shift + Z

into this

### DaVinci Resolve Shortcuts for Views and Displays
| Zoom | to |
| Full-Screen | Viewer: |
| Cinema | Viewer: |
| Retime | Controls: |
| Loop/Unloop: | Ctrl/Cmd+/ |

though note that you still need to add headers to the tables, that is,

| What | Keys |
| --- | --- |
| Something | Ctrl+Alt+S |