Reformatting a list? (Solved)

For discussions about programming, and for programming questions and advice


Moderator: Forum moderators

Post Reply
User avatar
taersh
Posts: 951
Joined: Tue Jul 07, 2020 11:13 pm
Location: Germany
Has thanked: 53 times
Been thanked: 119 times

Reformatting a list? (Solved)

Post by taersh »

Hi.

I have a list of files stored/echoed into a text file, e.g.:
Harp_a_1.wav Harp_a_4.wav Harp_a_7.wav
How to reformat it to have the text file's content look like that:
Harp_a_1.wav
Harp_a_4.wav
Harp_a_7.wav
???
Last edited by taersh on Tue Oct 27, 2020 12:08 pm, edited 1 time in total.

My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!

User avatar
MochiMoppel
Posts: 1139
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 18 times
Been thanked: 372 times

Re: Reformatting a list?

Post by MochiMoppel »

sed -i 's/ /\n/g' /path/to/textfile
User avatar
taersh
Posts: 951
Joined: Tue Jul 07, 2020 11:13 pm
Location: Germany
Has thanked: 53 times
Been thanked: 119 times

Re: Reformatting a list? (Solved)

Post by taersh »

Works good. Thanks.
You're an expert for real! :thumbup:

My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!

Post Reply

Return to “Programming”