Deleting output of your Firefox bookmarks as CSV with Excel

slack7639

Board Regular
Joined
Apr 19, 2016
Messages
57
Question: I export my bookmarks from Firefox as a CSV file, and use other macros to work with them in Excel.
My question is, why does the CSV have to be in the same folder as the BAT file that I use to delete it?
If I export the CSV to Desktop or Temp, it doesn't do anything.
Is it some "shell" or security thing?
Here's the code below:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

EXCEL MACRO THAT RUNS THIS BAT FILE, WHICH EXPORTS THEM USING SQLITE:

Sub SQLite3_BAT_File(control As IRibbonControl)

Dim BAT_BOOKMARKS As String
BAT_BOOKMARKS = "C:\1\01\1 backup\a Bookmarks BAT files\a\Bookmarks.bat"
Call Shell(BAT_BOOKMARKS, vbNormalFocus)

End Sub

- - - - - - - - - -

@Echo OFF

"C:\Program Files (x86)\SQLite3\sqlite-tools-win32-x86-3210000\sqlite3.exe" < "C:\1\01\1 backup\a Bookmarks BAT files\a\Bookmarks View.txt"

EXIT

- - - - - - - - - -

Bookmarks View.txt

.open C:/Users/USER/AppData/Roaming/Mozilla/Firefox/Profiles/u689l7dh.default/places.sqlite

.mode csv

.once "C:/1/01/1 backup/a Bookmarks BAT files/c/output.csv"

SELECT a.id AS ID, a.title AS Title, b.url AS URL, datetime(a.dateAdded/1000000,'unixepoch','localtime') AS Date FROM moz_bookmarks AS a JOIN moz_places AS b ON a.fk = b.id;

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

EXCEL MACRO THAT DELETES THE CSV:

Sub output_csv_del_DOS(control As IRibbonControl)

Dim DELETE_CSV As String
DELETE_CSV = "C:\1\01\1 backup\a Bookmarks BAT files\c\output csv del DOS.bat"
Call Shell(DELETE_CSV, vbNormalFocus)

End Sub

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

@Echo OFF

DEL "C:\1\01\1 backup\a Bookmarks BAT files\c\output.csv"

EXIT

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Here's my "How To" to share, if you're interested:

bookmarks-to-CSV.pdf . . . This is a .pdf that I have made, and uploaded to my Google Docs . . . This first page provides all you need to know, to get your Firefox Bookmarks into a .csv file using SQLite3. This won't do anything to your Bookmarks, it just extracts a copy of them . . . Then, the next few pages provide the details of what's going on . . . Having the .csv, you can then use Excel macros to clean up garbage characters in the .csv, and then append them to other Bookmarks in an .xlsm . . . Within the .xlsm, further edit them, categorize (I do this on 18 fields), and sort (concatenate(concatenate)) (22K Bookmarks) . . . Then, you can do Boolean searches, or use the Advanced Filter! . . . bookmarks-to-CSV.pdf
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Watch MrExcel Video

Forum statistics

Threads
1,130,029
Messages
5,639,624
Members
417,101
Latest member
amoverton2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top