Hi All,
I want to keep the name of the songs with their respective extensions only.
Sample Code
03 Choti choti gaiya choti choti gaval.mp3
03---Brazil Dhol.mp3
03 PAYALIYA .mp3
04 - Isq Risk [Funmaza.com].mp3
04%20-%20Oh%20My%20Love(wapking.in).mp3
08 - A2 - Aasan Nahin Yahan [DJMaza].mp3
AE NAZNEEN SUNO NA.MP3
[Songs.PK] 02 - Revival - Hum Tumhare Liye - Aye Sanam Aaj Yeh Quasam - Lata and Talat.mp3
Output should be :
Choti choti gaiya choti choti gaval.mp3
Brazil Dhol.mp3
PAYALIYA .mp3
Love.mp3
Aasan Nahin Yahan.mp3
AE NAZNEEN SUNO NA.MP3
Revival - Hum Tumhare Liye - Aye Sanam Aaj Yeh Quasam - Lata and Talat.mp3
Thanks in Advance.
Pramod
RudiC
August 16, 2014, 2:06pm
2
That is a very heterogeneous sample; I'm not sure that can be done in one go. Tried
sed -r 's/^.*[0-9]{2}[^[:alpha:]]*//; s/\([^)]*\)//; s/\[[^]]*\]//; s/ \././' file
Choti choti gaiya choti choti gaval.mp3
Brazil Dhol.mp3
PAYALIYA.mp3
Isq Risk.mp3
Love.mp3
A2 - Aasan Nahin Yahan.mp3
AE NAZNEEN SUNO NA.MP3
Revival - Hum Tumhare Liye - Aye Sanam Aaj Yeh Quasam - Lata and Talat.mp3
, but unsure how ro remove that A2 -
without removing the Revival...
piece
Scott
August 18, 2014, 2:29pm
3
A more appropriate response here is the "what have you tried so far?" one, IMO. O/P, pleas consider into which sub-forum you post. This doesn't belong in "How to Post in the Unix and Linux Forums". Moved.
I suspect that this line:
04%20-%20Oh%20My%20Love(wapking.in).mp3
Should be
Oh My Love.mp3
In which case you want to replace %20
with space before the rest of RudiCs solution:
$ sed -r 's/%20/ /g; s/^.*[0-9]{2}[^[:alpha:]]*//; s/\([^)]*\)//; s/\[[^]]*\]//; s/ \././' infile
Choti choti gaiya choti choti gaval.mp3
Brazil Dhol.mp3
PAYALIYA.mp3
Isq Risk.mp3
Oh My Love.mp3
A2 - Aasan Nahin Yahan.mp3
AE NAZNEEN SUNO NA.MP3
Revival - Hum Tumhare Liye - Aye Sanam Aaj Yeh Quasam - Lata and Talat.mp3