搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

Export Bookmark Name and Location in Columns?

  • 5 回覆
  • 1 有這個問題
  • 9 次檢視
  • 最近回覆由 cor-el

more options

I'm playing around with something in Google maps and need to be able to export all my bookmarks with name (ie description) and location (ie URL) into a csv or txt file into two columns that can be edited in a text editor and then imported into google maps. All the export / backup routines leave me with files that are far too complex for me to manually edit into this format. Anyone any ideas how i can do this please? Thanks.

I'm playing around with something in Google maps and need to be able to export all my bookmarks with name (ie description) and location (ie URL) into a csv or txt file into two columns that can be edited in a text editor and then imported into google maps. All the export / backup routines leave me with files that are far too complex for me to manually edit into this format. Anyone any ideas how i can do this please? Thanks.

所有回覆 (5)

more options

This way you can export book marks into HTML formats https://support.mozilla.org/en-US/kb/export-firefox-bookmarks-to-backup-or-transfer

you may then be able to organize it the way you want

more options

Thanks for the reply. I have tried exporting to HTML and backing up to json. Both result in unwieldy files that are not designed for human interpretation. URL's and descriptions are discernible but so entangled with other long strings of text, not in columns or tabs or a csv format that its impossible.

Its frustrating because the FF bookmarks view when showing only name and location show exactly what I am seeking but in an editable text file.

Thanks again.

由 rwpbrown 於 修改

more options

JSON files are a pain due to there being no line breaks which would provide crude formatting.

If you would open the bookmarks.html file in Firefox that file can be easily made editable. Not 'columns' but there are paragraph type breaks and line offsets that equate to the folders in the users bookmarks.

Just open a bookmarks.html file using File > Open File ... in Firefox and view it before dismissing using that file.

These are different support articles about how to make HTML contant being viewed in Firefox editable by the user. https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Editable_content

https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Midas

http://kb.mozillazine.org/Midas

That editing can be done by highlighting and deleting, and copy'n'pasting.

HTML is a human readable text file but with the long strings of "favicon.ico" ICON="data:image/png;base64 data in a bookmarks.html it requires a bit of patience when reading those file.

more options

Let's say the links you want are all adjacent in your exported bookmarks.html file. Then you could select those links and use a script in the Web Console (or a bookmarklet) to throw up a CSV formatted version of the links.

Like:

var rng = window.getSelection().getRangeAt(0); 
if (!rng.collapsed){
  var dNew = document.createElement('div'); 
  dNew.appendChild(rng.cloneContents()); 
  var aEls = dNew.querySelectorAll('a[href], area[href]'); 
  if (aEls.length > 0){
      dNew.innerHTML = '<textarea style="width:100%; height:100%; color:#ffc; background-color:#006;"></textarea><button onclick="this.parentNode.remove(); return false;" style="position:absolute; right:1em;">X</button>'; 
      var sTemp = '"Title","URL"'; 
      for(var i=0; i<aEls.length; i++){
        sTemp += '\n"' + aEls[i].textContent.replace(/"/g, '`') + '","' + aEls[i].href + '"';
      }; 
      dNew.setAttribute('style', 'position:fixed; width:80%; height:80%; top:5%; left:5%; color:#fff; background-color:#000; padding:1em;'); 
      document.body.appendChild(dNew); 
      dNew.childNodes[0].textContent += sTemp;
    }
} 

More info on the Web Console: https://developer.mozilla.org/docs/Tools/Web_Console

(Based on a "Selection Links" bookmarklet I found in a crusty old folder in my bookmarks.)

more options

If you do a copy of selected bookmarks to the clipboard then you get the text/html flavor (<a href="location">name</a>) on the clipboard that you can paste in an HTML capable editor.


You can also possibly use an SQLite utility and open places.sqlite. You can use a suitable query to create a list of the bookmarks showing name and location. You can export the list to a CSV file. There are also utilities that can convert JSON data to CSV.