简体   繁体   中英

How to remove png logo from m3u file

I have a m3u file and the lines are formatted like this below. I want to get rid of the "tvg-logo="https://i.imgur.com/TVint.png" , but every line has different URL and name for the png of course.

I guess i have to use sed or vi for this.

Which sed or vi code warrior can help me out?

--- example line below ---

EXTINF:-1 tvg-name="TV International" tvg-id="TV International" group-title="INT" tvg-logo="https://i.imgur.com/TVint.png",TV International
https://TVlive1-lh.tv.net/i/tv_live04@423398/index_4000_tv-b.m3u8
sed -ri 's@(^.*)( tvg-logo.*\")(,.*$)@\1\3@' file.m3u

Use regular expressions with -r and then split the string into three sections (specified in parenthesis). Substitute the line for only the first, followed by the third sections.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM