You are not logged in.
So I am trying to edit a playlist file which has multiple expressions that are 99% the same but I don't know how to edit these all at once. My playlist is quite huge so I am avoiding going through line by line.
Does anyone know what a good editor is that can change:
File220=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/07-Uncertanity Blurs The Vision.mp3
File221=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/08-Cock-Rock Alienation.mp3
File222=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/09-Retreat To Nowhere.mp3
File223=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/10-Think For A Minute.mp3
File224=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/11-Display To Me.mp3
File225=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/12-From Enslavement To Obliteration.mp3
File226=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/13-Blind To The Truth.mp3
File227=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/14-Social Sterility.mp3
File228=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/15-Emotional Suffocation.mp3
File229=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/16-Practise What You Preach.mp3
File230=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/17-Inconceivable_.mp3
File231=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/18-Worlds Apart.mp3
File232=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/19-Obstinate Direction.mp3
File233=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/20-Mentally Murdered.mp3
File234=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/21-Sometimes.mp3
File235=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/22-Make Way!.mp3
File236=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/23-Musclehead.mp3
File237=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/24-Your Acheivement.mp3
File238=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/25-Dead.mp3
File239=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/26-Morbid Deceiver.mp3
File240=Music/N/Napalm Death/(1988) From Enslavement To Obliteration/27-The Curse.mp3
to
Music/N/Napalm Death/(1988) From Enslavement To Obliteration/07-Uncertanity Blurs The Vision.mp3
Music/N/Napalm Death/(1988) From Enslavement To Obliteration/08-Cock-Rock Alienation.mp3
Music/N/Napalm Death/(1988) From Enslavement To Obliteration/09-Retreat To Nowhere.mp3
I.e. removing the "File" with the numerical part.
Last edited by Döbbie03 (2016-01-24 00:17:11)
"All we are is dust in the wind, dude"
- Theodore "Ted" Logan
"Led Zeppelin didn't write tunes that everybody liked, they left that to the Bee Gees."
- Wayne Campbell
Offline
awk -F= '{print $2}' epic-playlist > new-playlist
(replace 'epic-playlist' with the actual name of the file, and 'new-playlist' with the name of the new list)
Last edited by porkpiehat (2016-01-24 00:12:29)
Offline
Genius!
Thanks so much.
"All we are is dust in the wind, dude"
- Theodore "Ted" Logan
"Led Zeppelin didn't write tunes that everybody liked, they left that to the Bee Gees."
- Wayne Campbell
Offline
You're welcome!
Another option is "cut" :
cut -d= -f2 epic-playlist > new-playlist
Both awk and cut do the same thing here -- separate the lines at the =, and print only the second field (everything after the = )
Last edited by porkpiehat (2016-01-24 01:03:03)
Offline
I was going to suggest sed:
sed -i -e 's/^.\{8\}//' /path/to/playlist/play_list
EDIT: Looking at John's post below:
sed -i s/.*=// ~/playlist
Nice... learned a new one.
Last edited by Sector11 (2016-01-24 12:04:07)
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Just to add yet another method:
Geany also has built-in search-and-replace, which can use regular expressions.
Search>Replace...
Check "Use regular expressions".
Put
.*=
in "Search for:"
Leave "Replace with:" empty, and click "Find" "Replace" or "Replace & Find" to taste.
Handy if you've already opened the file anyway.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
I use CTRL+H in geany all the time. Very handy when you need to replace all occurrences of a variable with something else, for instance.
Offline
Or use vim:
:%s/.*=//gc
(-:
Offline
(Heretic in me speaking) one advantage of doing a search-and-replace in a GUI is that you can check you really want to replace each string before you do it. Unless you've been extremely careful to craft a watertight regex you often find geany trying to change something extra...
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline