python_cli
This is an old revision of the document!
Table of Contents
using python instead of tr
get_column_names.py $filename | grep -i coupon | \ python -c "import sys; print(','.join(line.strip() for line in sys.stdin))"
sort lines by length
import fileinput print("".join(sorted(fileinput.input(), key=len)))
On the command line:
% cat random_snippets.txt | python -c 'import fileinput; print("".join(sorted(fileinput.input(), key=len)))'
Ref:- https://stackoverflow.com/questions/34401683/how-to-use-awk-to-sort-lines-by-length/
sql string in clause
cat junk3.txt | \ python -c "import sys; print('\'', '\', \''.join(line.strip() for line in sys.stdin), '\'', sep='')"
python_cli.1614491534.txt.gz · Last modified: 2021/02/28 05:52 by raju