Hello,
I do "sort -du Mailfile.txt > Outfifle.txt". The textfile is including @. Command "sort" should sort the textfile
and remove duplicate text. In "okteta" command the ascii-value (40) of @ is grayed out. The textfile is
done with "kwrite" and every line is ended with newline. Problem: Duplicate lines are not removed and
some lines are not sorted. I think I have missed some option in the command.
ostene
sorting including @ in textstring
Re: sorting including @ in textstring
sort is locale-dependent
Code: Select all
$ echo $'@c\nb\na'|LC_ALL=en_US sort
a
b
@c
Code: Select all
$ echo $'@c\nb\na'|LC_ALL=C sort
@c
a
b
Re: sorting including @ in textstring
It's entirely possible that I am wrong about this, but I don't think sort removes duplicates. Use "sort | uniq" for that.
Re: sorting including @ in textstring
@Whoever:
man sort wrote:-u, --unique
with -c, check for strict ordering; without -c, output only the first of an equal run