I would like reverse the order of pairs of lines of a text file (m3u playlist).This is the original content of the m3u file:#EXTM3U#EXTINF:-1,AL: Klan HD (AL)http://mydomain.org:8000/live/username/mypass/1.ts#EXTINF:-1,AL: Klan HD Beckuphttp://mydomain.org:8000/live/username/mypass/2.ts#EXTINF:-1,AL: Klan Kosovahttp://mydomain.org:8000/live/username/mypass/3.ts#EXTINF:-1,AL: Klan Kosova (B)http://mydomain.org:8000/live/username/mypass/4.ts#EXTINF:-1,AL: Top Channel SDhttp://mydomain.org:8000/live/username/mypass/5.ts#EXTINF:-1,AL: Top Channel HDhttp://mydomain.org:8000/live/username/mypass/6.ts#EXTINF:-1,AL: Top Channel Beckuphttp://mydomain.org:8000/live/username/mypass/7.ts#EXTINF:-1,AL: TV Uskanahttp://mydomain.org:8000/live/username/mypass/8.tsI need to reverse it like this:#EXTM3U#EXTINF:-1,AL: TV Uskanahttp://mydomain.org:8000/live/username/mypass/8.ts#EXTINF:-1,AL: Top Channel Beckuphttp://mydomain.org:8000/live/username/mypass/7.ts#EXTINF:-1,AL: Top Channel HDhttp://mydomain.org:8000/live/username/mypass/6.ts#EXTINF:-1,AL: Top Channel SDhttp://mydomain.org:8000/live/username/mypass/5.ts#EXTINF:-1,AL: Klan Kosova (B)http://mydomain.org:8000/live/username/mypass/4.ts#EXTINF:-1,AL: Klan Kosovahttp://mydomain.org:8000/live/username/mypass/3.ts#EXTINF:-1,AL: Klan HD Beckuphttp://mydomain.org:8000/live/username/mypass/2.ts#EXTINF:-1,AL: Klan HD (AL)http://mydomain.org:8000/live/username/mypass/1.tsI have already got it like this:http://mydomain.org:8000/live/username/mypass/8.ts#EXTINF:-1,AL: TV Uskanahttp://mydomain.org:8000/live/username/mypass/7.ts#EXTINF:-1,AL: Top Channel Beckuphttp://mydomain.org:8000/live/username/mypass/6.ts#EXTINF:-1,AL: Top Channel HDhttp://mydomain.org:8000/live/username/mypass/5.ts#EXTINF:-1,AL: Top Channel SDhttp://mydomain.org:8000/live/username/mypass/4.ts#EXTINF:-1,AL: Klan Kosova (B)http://mydomain.org:8000/live/username/mypass/3.ts#EXTINF:-1,AL: Klan Kosovahttp://mydomain.org:8000/live/username/mypass/2.ts#EXTINF:-1,AL: Klan HD Beckuphttp://mydomain.org:8000/live/username/mypass/1.ts#EXTINF:-1,AL: Klan HD (AL)#EXTM3UBut it isn't what I need.
Reverse the order of pairs of lines of a text file
text processing