By the power of SED

It\'s a graph!I think I have just used sed for the first time. Well the first time where I have decided what the problem is and that the solution requires sed, and then using it.

This is a big deal for me. I have been aware of sed, and awk for a log time. I have even used them either when advised by others or as part of scripts that I have run (but not written).

This time, however, I can say it is all my own work. I have some data at work that I need to graph. There is too much to simply load into a spreadsheet, so I have to munge it a bit before I can use it. A simple perl program does that for me, and outputs a csv file that I can quickly load into a spreadsheet and make a graph. Once it I am happy that the data is correct, I then use Gnuplot to generate my final graphs. The problem is that gnuplot likes to have tab separated values, not comma separated. Here comes sed to the rescue.

sed 's/,/\t/g' data.csv >data.txt

Now that may not exactly be rocket science, but I very nearly wrote my own perl program to do that for me.