I want to find duplicated name from the file like below and marked them with \"\".
file:
James Miki:123-456-7890 Wang Tai: 234-563-6879 James Miki: 123-
Another alternative using sed + sort + uniq pipeline:
sed
sort
uniq
cat file | sed 's/^\(.*\) *: */"\1": /' | sort | uniq -d
The output:
"James Miki": 123-456-7890