Sorting and outputting in another file
332
To sort Names.txt
in a reverse sort order and output it into SortedNames.txt
:
sort -r Names.txt > SortedNames.txt
The file SortedNames.txt
does not have to exist. If it does exist and you have write-permission to that file, the command above will overwrite its contents.
The sort command has many more options.
Related videos on Youtube
Author by
drbernardi
Updated on September 18, 2022Comments
-
drbernardi over 1 year
I'm a novice at regex and can't find a way to do this easily. I'd like to delete every word that isn't starting with # and put a comma between them, so for example if I have:
Cookie Recipe for n00bs #cookie #recipe #chocolate To do this you have to etc... Bla bla bla mumbo jumbo
I'd like to get as a result:
cookie, recipe, chocolate
If you could help me it'd be great, thanks and have a good day!
-
Casimir et Hippolyte over 9 yearsinstead of deleting all the words not preceded with a
#
, why you don't try to match words preceded with a#
? -
Casimir et Hippolyte over 9 yearsWhat language/tool do you use?
-
drbernardi over 9 yearsI'm trying to use this in a Find and Replace context.I'm creating a Keyboard Maestro Macro which filters the clipboard following this Find and Replace rule. I don't know of a way to only copy the matched Find.
-