Sometimes when I export MySQL to files, I end up having one huge query on one line. It can be quite annoying! I’d rather want it on several lines; in that way it easier to just copy out a fragment of the query. And it also seems that some editors handle several lines better than one huge. Well, in this case my line looked like this:
INSERT INTO TABLE VALUES (...),(...),(...),(...),(...),(...),(...),(...),(...),(...),(...),(...),(...),(...),(...),(...),(...),(...),(...),(...);
With this sed-command, every entry got its own line:
sed s/\),\(/\),\\n\(/g export.sql > one-per-line.sql
