4 ms·
Yes. Scratching your own itch is one of the funnest parts of scripting. I made simple script that converts DB ids output per line that you'd get from a query i
by racl101 5y ago
Yes. Scratching your own itch is one of the funnest parts of scripting.
I made simple script that converts DB ids output per line that you'd get from a query into a comma separated line with a one line bash script.
e.g. converts:
1
2
3
to:
1, 2, 3
Since I do a lot of querying it is very helpful. To achieve the same thing in Excel is a fucking nightmare.
The cool part is when I feed it like 50000 lines of input how relatively quick it does it.
alias onelinify="paste -d, -s -"
example usage (on macos): cat db-ids.txt | onelinify | pbcopy
- bolasanibk 5y agoOn MySql I used group_concat function to do the same thing.
- racl101 5y agoIt works alright on a few hundred lines but not on thousands. It truncates the output. Or at least my SQL client (Sequel Pro) does.