Python Forum
a new kind of cut command - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: a new kind of cut command (/thread-19058.html)



a new kind of cut command - Skaperen - Jun-12-2019

i have run across the need many times to cut an input file that has a mix of delimiters (or is layered) or i need to columns in a different order, or often both. i have ideas on how to to express the desires and how to parse that expression. the need arose as a need for a command by my thought is to code it as a generator and use that generator in a simpler command.

any suggestions as to other needs that might fit into this? the generator would take a string and yield either a string or a list. i think it might be good to "compile" the expression into a sequence of actions such as function calls for reasonably faster performance.