Is it possible to parse a file line through a line, and it is possible to edit a line in in-play ?
Is it possible to parse a file line through a line, and at the same time Is it possible to edit lines through?
This can be simulated as a stdlib using a backup file.
Here is an example script that can be copied from files given on
any_condition command line orstdin :#! Import file input for line in / usr / bin / env python # grep_some_condition.py file input. Input (inplace = true, backup = '. Bak'): If some codification (line): print line, this current fileexample:
$ Python grep_some_condition.py first_file.txt second_file.txton completion
first_file.txt andsecond_file.txt files only rows th Includesome_condition () predicate satisfied.
Comments
Post a Comment