I've tweaked Stefans code a bit to make it a one liner that I can include into another script that does the mysql import too. The thing with the double qoutes also works out very well. The line I use now is:
sed "s/^\(..\) /INSERT INTO playlist VALUES ($1, \1, \"/g;s/ - /\", \"/g;s/$/\");/g"...
Hi,
I would like to automatically convert a plain text file containing a playlist to a sql script to import the proper data into an existing table. I'm running a linux server with all these powerful built-in tools like awk, sed and grep but I don't know how to use them proper. I guess a fancy...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.