Hi Guys,
I need to write a script, that exports the "moz_places" table of the "places.sqlite"-file (firefox browser history) into a csv-file. That part works. After the export, my csv looks like this:
...
4429;http://www.sqlite.org/sqlite.html;"Command Line Shell For SQLite";gro.etilqs.www.;3;0;0;98;410;1265905218764118
4562;http://www.unix.com/shell-programming-scripting/127699-question-about-function-calls.html#post302386693;"Question about Function calls - The UNIX and Linux Forums";moc.xinu.www.;1;0;0;182;47;1263646391422534
...
Now I want to extract just the visited URL and the date of this visit for all visits.
I did this like this:
awk -F ';' '{print $10, $2}' temp.csv
this works and the result looks like this
1263646291226002 http://www.unix.com/cfmgoogle.php?cx=partner-pub-6323928554267084%3Absye1r5tx7j&cof=FORID%3A10&q=xml&sa=Grep&siteurl=www.unix.com%2F
1263646297314065 http://www.unix.com/cfmgoogle.php?cx=partner-pub-6323928554267084%3Absye1r5tx7j&cof=FORID%3A10&q=xml&sa=Grep&siteurl=www.unix.com%2F#1333
1263646362729683 http://www.unix.com/cfmgoogle.php?cx=partner-pub-6323928554267084%3Absye1r5tx7j&cof=FORID%3A10&q=xml+shell&sa=Grep&siteurl=www.unix.com%252F
Okay, and here's my problem. I don't need a timestamp in front of the visited URL, I need a date. It should look somehow like this:
...
Do 11. Feb 19:00:23 CET 2010 www.google.com
...
(Sorry, my date is in german)
I know that I have the reduce the timestamp which I get of firefox to the first 10 characters, because the rest doesn't belong to the date. I already found out how to do this with awk:
awk -F ';' '{print((substr($10,1,10)))}' < temp.csv
but how can I convert this
1265911223 www.google.com
into this
Do 11. Feb 19:00:23 CET 2010 www.google.com
I know how I can convert one single date in commandline
date -d @1265911223
but how can i do this for the whole csv. I tried to store the timestamp into a variable, but i don't know how to do this for line after line. As I tried, it stored all timestamps in a long sting in the variable. I thought it would be easier to do this... Maybe someone of you can help:confused:
Greetings
Sebi