| Selecting and extracting text between two defined markers what text processing tool/script? |
Casethejoint

msg:3068588 | 9:45 am on Sep 1, 2006 (gmt 0) | I have 100s of full html pages but want to extract only the content, which is clearly marked with comments ( ie. <!-- Content begins/ends here --!> ). Rather than just cutting and pasting into separate files, how would you approach it? Is there some console cleverness that can be used?
|
coopster

msg:3069016 | 5:29 pm on Sep 1, 2006 (gmt 0) | shell, perl or some other form of server-side scripting would be ideal here. Loop through the files in the directory, locate the string in between the comments and write them out to a new directory/files.
|
Casethejoint

msg:3069255 | 8:17 pm on Sep 1, 2006 (gmt 0) | Hey Coopster - both sed and awk do the trick. Just not sure how to apply the correct phrasing to a whole directory. Anyhow, trial/error etc :)
|
|
|