alecthomas/pawk

[new feature] auto covert possible column to numerical

wavefancy opened this issue · 5 comments

change:
echo '1 2' | pawk 'int(f[0])<=1'

to:
echo '1 2' | pawk 'f[0]<=1'

We do not need to make the conversion every time, especially when we have many operations.

Thanks much!

How would this work exactly? The fields are just Python strings and the code is just normal Python.

Sorry, I should have been clearer. I more meant how would that work at a holistic level. eg. If integer strings are converted to integers then this would fail: ','.join(f)

I don't think it's a good idea, but I'd be interested in any ideas.

Right but then you've solved one annoyance and introduced another...