Article 5DWVY [SOLVED] cut lines out of text file possibly using sed

[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:
sed -i 'string to search for/d' .get_iplayer/download_history
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?

TIAlatest?d=yIl2AUoC8zA latest?i=4dW1u7hct7k:fp5rKNgzzmU:F7zBnMy latest?i=4dW1u7hct7k:fp5rKNgzzmU:V_sGLiP latest?d=qj6IDK7rITs latest?i=4dW1u7hct7k:fp5rKNgzzmU:gIN9vFw4dW1u7hct7k
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments