diff --git a/xonsh/LinesToList.xsh b/xonsh/LinesToList.xsh new file mode 100755 index 0000000..f7d1dda --- /dev/null +++ b/xonsh/LinesToList.xsh @@ -0,0 +1,9 @@ +#!/usr/bin/env xonsh +print("Method1: map and str.strip") +for i in map(str.strip, !(cat /tmp/test.txt)): + print(i) + +print("Method2: splitlines") +#for j in $(cat /tmp/test.txt).splitlines(): +for j in !(cat /tmp/test.txt).out.splitlines(): + print(j)