Shell script or other method to convert firefox bookmark file to excel
I have a big file of links
I have some entries in this format: Code:
<A HREF="http://www.....html" ADD_DATE="1271073056" LAST_MODIFIED="1271073061">18010139</A> Code:
<a href=http://www....html>02230726</a> Need to convert them into an excel spreadsheet, preferably so they are in this format Code:
A B C |
Quote:
|
Thankyou for that, unfortunately I do not have time to do this in perl. Can you suggest where I might find this sort of tool online?
By the way this is not homework, but is actual work! It is my own fault the files are not in the format required, need a quick fix. |
Does this file contains these two samples only. or it contains other text as well ?
Can you assure that each line contains one link only ? Column A and Column B will be same ? |
Saying you don't have time is just an excuse. Time is never enough for everybody, not just you. Its up to yourself to find the time. No time ? then cut down on your parties, spend 1 or 2 hrs before you sleep to learn etc. after all, its for your work right?
Back to topic, you can use Python. Assuming you are not using later version of firefox which uses json instead Code:
import re |
Code:
perl -e 'while(<>){ /href="?(.*?)(".*)?>/i; my $url=$1; />(.*)</; my $code = $1; print "$code,$code,$url\n"; }' <file> |
In case this helps, regarding post #5 -- even the shiny new Firefox can/will export your bookmarks as HTML, even though it uses JSON internally. Select Bookmarks -> Organize -> Import/Backup -> Export HTML, and then you could proceed with post #5 if you like (or whatever method, if your chosen method wants to begin with an HTML-formatted file).
|
Quote:
|
Thanks for your responses.
@PMP that works great, thanks! I now have all the data in an Excel Spreadsheet. |
Quote:
"Programming by coincidence" (c). |
Quote:
Quote:
I respect your thoughts, Given the choice I would have gone for a HTML parser to do so :) "Programming by assumption" :D |
All times are GMT -5. The time now is 03:32 PM. |