Batch script to delete all the lines from the line that starts with a specific word "TRAIL" -


i want write batch script first time , struck.

the requirement is: want delete lines in text file comes after line starts letters "trai......".

example: test file looks like:

123 sdefef dhufheij 123232 234 ddefef mijijijj 232323 345        jcdhence 345987 trailer0000034 456 edrftg nbuyfjjf 678655 

result should be:

123 sdefef dhufheij 123232 234 ddefef mijijijj 232323 345        jcdhence 345987 456 edrftg nbuyfjjf 678655 

this can done sed find pattern

sed -i 's/trai.*//' your_file.txt 

the -i flag modifies actual file. "s/trai.*//" finds pattern starting trai , follows (represented .*) , replaces nothing

edit: nevermind, misread "batch script" "bash script"


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -