4 ms·
> cat webpage.html | grep 'mailto:' | cut -d '"' -f 5 | cut -d '"' -f 1 > emails.txt This is great! I can't believe I've never run into "cut" before. In simila
by AlchemistCamp 7y ago
> cat webpage.html | grep 'mailto:' | cut -d '"' -f 5 | cut -d '"' -f 1 > emails.txt
This is great! I can't believe I've never run into "cut" before. In similar spots, my workflow would have been filtering the lines with grep and then opening the file in VI to finish the task.
- ptah 7y agoyip, that's why learning vi is essential for comuputational survivalism. most unix systems has it
- pjc50 7y agoAnother alternative would be to do the transformation with sed or awk, or if you require more complex regexes, perl with the "-i" and "-e (single line of code)" options. Cut has a mirror image program, "paste", but I've not yet hit a use case for it.
- ulucs 7y agoI used it once for counting n-grams while making a markov chain generator