I have data in zdt
format (like this), where I want to perform this python script only on the third column (the pinyin one). I have tried to do this with sed
and awk
but I have not had any success due to my limited knowledge of these tools. Ideally, I want to feed the column’s contents to the python script and then have the source replaced with the yield of the script.
This is roughly what I envision but the call is not executed, not even when in quotes.
s/([a-z]+[1,2,3,4]?)(?=.*\t)/decode_pinyin(\1)/g
I am not too strict of the tools (sed
, awk
, python, …) used, I just want a shell script for batch processing of a number of files. It would be best if the original spaces are preserved.