I am trying to auto create m3u file for my IPTV software with the help of sed/awk or grep command,but don't have much experience in this. expert help required to do this. **working on Windows-10 PC environment cmd**.

I have raw file having approx 500 lines of video file links like

``english.movie.com/movies/english/a/example.moviename1/example.moviename1.BRRip.Dual.mkv``
``english.movie.com/movies/english/a/example.moviename2/example.moviename2.WEBRip.avi``
``english.movie.com/movies/english/a/example.moviename3/example.moviename3.DVDRip.avi``

I want to automate the procedure to write following lines in m3u file and include raw file link and its movie name in m3u file, m3u file lines are. single line example

``#EXTINF:-1 xui-id="101" tvg-id="" tvg-name="example.moviename1" tvg-logo="" group-title="MoviesEnglish-A",example.moviename1``
``http://english.movie.com/movies/english/a/example.movienam1/example.moviename1.BRRip.Dual.mkv``

and so on till raw file ends.

where in first line of m3u file.

xui-id, starts from lets say **101**, what ever start number I set in start of script.

tvg-name, should be a movie name, which should be picked **after 4th forward slash, and ends at 5th forward slash** from raw file line.

I used following command to get movie name and its works.

``awk -F / "{ print $5; }"``

group-title, whatever name I set in start of script. 

and again movie name should be picked **after 4th forward slash and ends at 5th forward slash** from raw file line after group-tile

in second line of m3u file. raw file line should be written after **http://**

I think there should be some loop involve to fulfill my need, I am working on it and still not able to get results.

if my explanation of my question disturb you to understand my need, in this case please guide me.