Results 1 to 4 of 4
1) How to print section of file beginning from 63 character and ending 127 character?
2) How to delete section of file beginning from 63 character and ending 127 character?
...
- 09-28-2007 #1Just Joined!
- Join Date
- Sep 2007
- Posts
- 3
several questions of using "sed"...
1) How to print section of file beginning from 63 character and ending 127 character?
2) How to delete section of file beginning from 63 character and ending 127 character?
3) How to print section of file beginning from 63 character and ending by character of "end of line"?
- 09-28-2007 #2Just Joined!
- Join Date
- Sep 2007
- Posts
- 3
use head and tail, not sed
look at the man pages for head and tail. you should be able to accomplish what you want with simple pipelines using those utilities.
BB
- 09-28-2007 #3Just Joined!
- Join Date
- Sep 2007
- Posts
- 3
- 09-28-2007 #4Just Joined!
- Join Date
- Sep 2007
- Posts
- 3
no problem with awk
Actually head and tail wouldn't help with #3 but you can do all three with awk. As you process lines get the number of bytes in each line with length($0). You should have no trouble identifing the bytes greater than the starting offset and less than the ending offset. You will need some other bookkeeping and you will need to use substr() to print or capture what you want.
BB


Reply With Quote
