Issue
Given a file ./wordslist.txt
with <word> <number_of_apparitions>
such as :
aš toto 39626
ir 35938
tai 33361
tu 28520
kad 26213
...
How to exclude the end-of-lines digits in order to collect in output.txt
data such :
aš toto
ir
tai
tu
kad
...
Note :
Sed
, find
, cut
or grep
prefered. I cannot use something which keeps [a-z] things since my data can contain ascii letters, non-ascii letters, chinese characters, digits, etc.
Solution
I suggest:
cut -d " " -f 1 wordslist.txt > output.txt
Or :
sed -E 's/ [0-9]+$//' wordslist.txt > output.txt.
Answered By - Cyrus