I have a list of values like so:
CAT
Dog
cat
Cow
dOg
I want it to have unique entries in quotes like this:
'CAT'
'Dog'
'Cow'
Is there a shortcut in Atom for this?
The uniq command is used to remove duplicate lines from a text file in Linux. By default, this command discards all but the first of adjacent repeated lines, so that no output lines are repeated. Optionally, it can instead only print duplicate lines. For uniq to work, you must first sort the output.
Answer : DISTINCT. The SQL DISTINCT keyword is used after the SELECT statement and is used to eliminate all the duplicate records and fetch the unique records.
Not at the moment. But if you are on a POSIX like system (Linux and MacOS by default, Windows with some help), you can make use of the atom package 'pipe'
Just mark your text and pipe it through this command:
sort -f | uniq -i
or with the long options (yes, sort has -f
and uniq -i
):
sort --ignore-case | uniq --ignore-case
On my system that results in:
cat
Cow
dOg
Please note that uniq
want's its input sorted and similar entries following each other. Thats why your need to sort
them first
atom now has a plugin called duplicate-removal
which will remove duplicate lines automatically
https://atom.io/packages/duplicate-removal
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With