News for hackers. Stuff that matters.
Re:Problem solving with Unix commands by ciucanu on Thursday February 14, 2019 @05:37AM (#19160914)
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 ...

Re:Problem solving with Unix commands by james_s_tayler on Thursday February 14, 2019 @06:53AM (#19161207)
As 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]++'
Re:Problem solving with Unix commands by omaranto on Thursday February 14, 2019 @08:49AM (#19161794)
The 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.
Re:Problem solving with Unix commands by pnutjam on Thursday February 14, 2019 @12:17PM (#19163643)
sort 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
Re:Problem solving with Unix commands by AnIdiotOnTheNet on Thursday February 14, 2019 @08:11AM (#19161573)
If 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.
Re:Problem solving with Unix commands by fxfan on Thursday February 14, 2019 @08:48AM (#19161784)
Ahem... what is powershell core? (I take exception to your if condition). As someone on Arch- I enjoy it a lot.
Re:Problem solving with Unix commands by 2038AD on Thursday February 14, 2019 @07:29AM (#19161363)
Bash with Notepad++ and Excel? Do you use Wine or WSL?
Re:Problem solving with Unix commands by ciucanu on Friday February 15, 2019 @02:52AM (#19169224)
It's kind of mandatory to use Windows in certain envs.