Text Manipulation
by GPGAgent from LinuxQuestions.org on (#5AS40)
Hi,
I have this file with a few hundred lines like this:Code:https://jk.org/Volume1/Books_1_chapter_2
https://jk.org/Volume1/Books_1_chapter_3
https://jk.org/Volume1/Books_1_chapter_four
https://jk.org/Volume1/Books_1_section_2and i want to do this with simple script:Code:https://jk.org/Volume1/Books_1_chapter_2/Books_1_chapter_2.mp3
https://jk.org/Volume1/Books_1_chapter_3/Books_1_chapter_3.mp3
https://jk.org/Volume1/Books_1_chapter_four/Books_1_chapter_four.mp3
https://jk.org/Volume1/Books_1_section_2/Books_1_section_2.mp3basically take the text after the last / and adding it to the same line and appending .mp3 to it.
I know how to do a bit of simpler string manipulation but not this one.
Any tips welcome
Cheers folks


I have this file with a few hundred lines like this:Code:https://jk.org/Volume1/Books_1_chapter_2
https://jk.org/Volume1/Books_1_chapter_3
https://jk.org/Volume1/Books_1_chapter_four
https://jk.org/Volume1/Books_1_section_2and i want to do this with simple script:Code:https://jk.org/Volume1/Books_1_chapter_2/Books_1_chapter_2.mp3
https://jk.org/Volume1/Books_1_chapter_3/Books_1_chapter_3.mp3
https://jk.org/Volume1/Books_1_chapter_four/Books_1_chapter_four.mp3
https://jk.org/Volume1/Books_1_section_2/Books_1_section_2.mp3basically take the text after the last / and adding it to the same line and appending .mp3 to it.
I know how to do a bit of simpler string manipulation but not this one.
Any tips welcome
Cheers folks