sed ?
My new router has a traffic meter on it. Unfortunatly it is only accessible from a web page with lots of JavaScript/Java in it. If anyone is employed here by netgear, Allow the user to either e-mail or ftp the data to themselves. You have an ftp server built right into the router. I managed to put a script together using firefox and iMacros. Then I format the output as a groups of MySQL insert statements which is then sent off via the script to the MySQL server. Ok, I got it working even though I had to do some things which aren't the best.
I couldn't format the insert statements with single quotes around the data items. I could get them formated with double quotes. I tried to use sed to change all of the double quotes to single quotes, but I couldn't get it to work. I ended up writing a tiny little Free Pascal program to do it.
The sed I tried was something like this:
sed s/'"'/'\''/ Traffic.dat
It would change some, but not all of them.
|