2
I am breaking my head with something very simple, I need to insert a ";" (point and comma) after a Sort/Uniq in a file. As it returns the number of repeated lines, I need this return that is always in the first column to be inserted this ";". I already searched with "CUT, AWK, SED" and I did not get a satisfactory result.
Example:
cat /tmp/filtrado2.txt| sort| uniq -c| sort -nr
Thank you for helping me.
What would this Sort/Uniq, a string ?
– Roknauta
Sort/Uniq is the command I set. I did a Sort and then Uniq, as the example I mentioned above. After the result by them, which is generated in the first column, wanted to insert the ";" in it.
– user54154
You can post the contents of your file ?
– Roknauta
Yes, before "Mar" has the value 1 which is the return of Sort + Uniq, and the string ";" should come right after this value. Remember, the default is only the column, because this value 1 does not always repeat, can be 1000, 45678, 2, and etc.
– user54154
1 Mar 3 00:01; 113.78.57.53; Unknown; <alonso4t@xxxx>; BS TOYS AND SAMBA TOYS - 3D FILES
– user54154
A desired input and output file helps. It can probably be done without using anything else that awk.
– fedorqui