Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I map a key in vi to help me join two lines together and then move to the next line. Rinse and repeat. This is part of the process to help me shuffle some #EXTM3U style playlists for my portable music player.
I map the key [ to do the following:-
1. Go to the end of the line ($)
2. Join two lines together (J)
3. Down arrow key to go to next line.
This works well except for the fact that some playlists may have 6000 lines in them. In which case, I sit there for a minute or so holding my finger down on the [ key.
My question is this. Is there a simple command in vi that I can use to achieve the same result? Or is there a more elegant way to do this, perhaps with sed or awk etc?
allend, Thanks for that. This works well if I first convert the playlist to unix format from dos format using dos2unix. I added --delimiters="" to the paste command so that the output did not have a TAB at the joined point.
Thank you to everyone who replied. I will now sit down and write a script that does everything I need to do to automatically massage these playlists so I don't have to do it all manually.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.