i want copy line have strings file
for eg
a file contain below lines
ram 100 50 gopal 200 40 ravi 50 40 krishna 300 600 govind 100 34
i want copy lines has 100 or 200 file skipping characters before (first occurrence in line)100 or 200
i want copy 100 50 200 40 100 34 file
i using sed -n '/100/p' filename > outputfile
can please me in adding lines 1 of string using single command
this might work (gnu sed):
sed -n '/[12]00/w anotherfile' file
only print if needed, write anotherfile
regexp matches 100
or 200
.
Comments
Post a Comment