riti90
Registered User.
- Local time
- Today, 03:40
- Joined
- Dec 20, 2017
- Messages
- 44
Hi All,
I'm trying to build a text parser for editing my IPTV playlist (as it has thousands of channels that I don't want).
They usually are spreaded within Lines in a good format, like this:
and I have managed to read this,
But sometimes it is saved like it's unformatted, like this:
Is there any way I could be able to parse it for both ways? I'm struggling to find a way how to do it...
Please find Attached the file to see where I've come so far and 2 sample txt files.
Thanks in Advance,
Margarit
I'm trying to build a text parser for editing my IPTV playlist (as it has thousands of channels that I don't want).
They usually are spreaded within Lines in a good format, like this:
Code:
#EXTM3U
#EXTINF:-1 tvg-id="" tvg-name="------|France|------" tvg-logo="" group-title="France",------|France|------
http://www.WebServer.com/UserName/Password/2866
#EXTINF:-1 tvg-id="13e.rue.fr" tvg-name="FR001:13 Eme Rue" tvg-logo="" group-title="France",FR001:13 Eme Rue
http://www.WebServer.com/UserName/Password/2865
#EXTINF:-1 tvg-id="6ter.fr" tvg-name="FR002:6Ter" tvg-logo="" group-title="France",FR002:6Ter
http://www.WebServer.com/UserName/Password/2864
#EXTINF:-1 tvg-id="ab.moteurs.fr" tvg-name="FR003:AB Moteur" tvg-logo="" group-title="France",FR003:AB Moteur
http://www.WebServer.com/UserName/Password/2863
#EXTINF:-1 tvg-id="ab.1.fr" tvg-name="FR004:AB1" tvg-logo="" group-title="France",FR004:AB1
http://www.WebServer.com/UserName/Password/2862
But sometimes it is saved like it's unformatted, like this:
Code:
#EXTM3U#EXTINF:-1 tvg-id="" tvg-name="------|France|------" tvg-logo="" group-title="France",------|France|------http://www.WebServer.com/UserName/Password/2866#EXTINF:-1 tvg-id="13e.rue.fr" tvg-name="FR001:13 Eme Rue" tvg-logo="" group-title="France",FR001:13 Eme Ruehttp://www.WebServer.com/UserName/Password/2865#EXTINF:-1 tvg-id="6ter.fr" tvg-name="FR002:6Ter" tvg-logo="" group-title="France",FR002:6Terhttp://www.WebServer.com/UserName/Password/2864#EXTINF:-1 tvg-id="ab.moteurs.fr" tvg-name="FR003:AB Moteur" tvg-logo="" group-title="France",FR003:AB Moteurhttp://www.WebServer.com/UserName/Password/2863#EXTINF:-1 tvg-id="ab.1.fr" tvg-name="FR004:AB1" tvg-logo="" group-title="France",FR004:AB1http://www.WebServer.com/UserName/Password/2862
Is there any way I could be able to parse it for both ways? I'm struggling to find a way how to do it...
Please find Attached the file to see where I've come so far and 2 sample txt files.
Thanks in Advance,
Margarit