4 ms·
I usually do text processing in Bash, Notepad++ and Excel. Each has its own pros and cons, that's why I usually combine them. Here you have the tools I use in
by ciucanu 8y ago
I usually do text processing in Bash, Notepad++ and Excel. Each has its own pros and cons, that's why I usually combine them.
Here you have the tools I use in Bash:
grep,
tail,
head,
cat,
cut,
less,
awk,
sed,
sort,
uniq,
wc,
xargs,
watch
...
- james_s_tayler 8y agoAs an aside I once found out you can replace 'sort | uniq' entirely with an obscure awk command so long as you don't require the output to be sorted. Iirc it performs twice as fast. cat file.txt | awk '!x[$0]++'
- omaranto 8y agoThe awk commands prints the first occurrence of each line in the order they are found in the file. I can imagine that sometimes that might be even better than sorted order.
- pnutjam 8y agosort has a -u option on my linux... ------ -u, --unique with -c, check for strict ordering; without -c, output only the first of an equal run
- 2038AD 8y agoBash with Notepad++ and Excel? Do you use Wine or WSL?
- ciucanu 8y agoIt's kind of mandatory to use Windows in certain envs.
- AnIdiotOnTheNet 8y agoIf you're already in Windows land, you should consider leveraging PowerShell instead of bash. Pretty much all the same tooling is there, only with more descriptive names, tab completion on everything, passes typed object data instead of text parsing, etc.
- fxfan 8y agoAhem... what is powershell core? (I take exception to your if condition). As someone on Arch- I enjoy it a lot.