Created
April 21, 2020 22:06
-
-
Save jucke/3bc6df688115b517a6fb5b7917991fdd to your computer and use it in GitHub Desktop.
Diff transformer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Let's say you have a diff: | |
| ``` | |
| 838a839 | |
| > p088x0zn| | |
| 841a843 | |
| > p088x0zt| | |
| 1167a1170 | |
| > p088z03m| | |
| etc. | |
| ``` | |
| And you need these pids in format 'p088x0zn', 'p088x0zt', `p088z03m` for a query. | |
| This will achieve desired transformation: | |
| cat diff.txt | grep -v ">" | grep -v "^[0-9c0-9]" | grep -oE "p[a-z0-9]{7}" | sed "s/.*/'&'/" | paste -sd, - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment