dipper.utils.pysed module¶
-
dipper.utils.pysed.
replace
(oldstr, newstr, infile, dryrun=False)¶ Sed-like Replace function.. Usage: pysed.replace(<Old string>, <Replacement String>, <Text File>) Example: pysed.replace(‘xyz’, ‘XYZ’, ‘/path/to/file.txt’)
This will dump the output to STDOUT instead of changing the input file. Example ‘DRYRUN’: pysed.replace(‘xyz’, ‘XYZ’, ‘/path/to/file.txt’, dryrun=True)
-
dipper.utils.pysed.
rmlinematch
(oldstr, infile, dryrun=False)¶ Sed-like line deletion function based on given string.. Usage: pysed.rmlinematch(<Unwanted string>, <Text File>) Example: pysed.rmlinematch(‘xyz’, ‘/path/to/file.txt’) Example: ‘DRYRUN’: pysed.rmlinematch(‘xyz’, ‘/path/to/file.txt’, dryrun=True) This will dump the output to STDOUT instead of changing the input file.
-
dipper.utils.pysed.
rmlinenumber
(linenumber, infile, dryrun=False)¶ Sed-like line deletion function based on given line number.. Usage: pysed.rmlinenumber(<Unwanted Line Number>, <Text File>) Example: pysed.rmlinenumber(10, ‘/path/to/file.txt’) Example ‘DRYRUN’: pysed.rmlinenumber(10, ‘/path/to/file.txt’, dryrun=True) #This will dump the output to STDOUT instead of changing the input file.