[SOLVED] cut lines out of text file possibly using sed
by timl from LinuxQuestions.org on (#5DWVY)
I would like to trim the download_history file which is used by get_iplayer. It seems to me that download_history is used to check whether you already have a show and therefore whether to download again. While this is valid for repeats I download weekly programmes which will never be repeated.
I can use sed to search for and delete these shows:
Quote:
But, shows are kept online for 4 weeks so I only want to delete up to a certain point. I can easily search the file and find the line I don't want to go past. Can I specify limits using sed?
I have seen other suggestions online to delete lines ('1:10d') but I can't see anywhere to specify a pattern and line limits?
TIA


I can use sed to search for and delete these shows:
Quote:
sed -i 'string to search for/d' .get_iplayer/download_history |
I have seen other suggestions online to delete lines ('1:10d') but I can't see anywhere to specify a pattern and line limits?
TIA