View Full Version : Beginner - Filtering a .txt file

2021-04-26, 16:24
I am currently trying to learn Kali Linux as my first ever Linux distribution and I am already struggling with my first given task in the VM 😅
So far I've learned about "sha1sum", pipes & simple sorting by using "sort" (which has been described as being enough for this task)

Now, let's say you have a .txt file with the following given elements :

Car 21
Bread 311
Car 09
Bread 32
Car 34
Bread 95

And now let's say you have ~1000 elements in your list instead.
The task would be to remove every element with a lower number (weight) than the maximum of each word. (Using the QTerminal)

For example in this list the remaining elements would be : Car 34 & Bread 311

My idea would be not to remove the lower number ones but filtering the maximum of each word into a separate .txt file
I'd appreciate it if anyone could give me a hint or guide through this, thank you ! 😄