Jump to content

Is there an easy way to merge information in two downloads.sqlite ?


Alan_B

Recommended Posts

In my absence a relative was working on my Desktop and upgraded CCleaner - but to a default location.

I continued to use the old version I am comfortable with and only after downloading many files did I notice the new version had by default zapped all download history.

I have a new Downloads.sqlite with information on 60 recent downloads,

and a backup copy of Downloads.sqlite as it was the day before it was zapped with history on well over 100 older downloads

 

I am using Firefox 7 and have added the Addon SQLITE Manager but do not know how to control it.

I do not wish to learn how to create SQL Queries.

 

I would appreciate advice on this.

 

So far I have :-

1.

I tried exporting one as a CSV and importing that CSV into the other.

Unfortunately that only replaced original content - did not merge

2.

selected each Downloads.sql file and exported as a CSV file and copied into a spreadsheet.

I have changed the first column cells of one CSV so that when the contents of one CSV are appended to the other CSV,

then all the items have appropriate sequential numbering.

I then imported that CSV

BIG FAIL - Firefox knows a forgery when it sees one.

 

It would be nice to achieve this, but not nice enough for me to spend more hours of learning and head-banging efforts.

 

Regards

Alan

Link to comment
Share on other sites

I NEVER clean the history. That is ALWAYS unchecked.

 

The problem is that my relative happened to install the latest CC in the default folder - which was horribly wrong and never saw my CCleaner.INI,

hence a single run used CC default settings that erased all history.

 

When I returned and saw the new and installed version I uninstalled it and continued to use my portable version.

Only after I had downloaded a large number of new files did I notice that History had lost previous information on all the old downloads

 

CCleaner is no longer deleting any history,

but I have a current downloads.sqlite that holds data on all my recent downloads,

and a backup copy of downloads.sqlite as it was before recent downloads and this still holds the old information.

 

All I want is to get both sets of data into a single downloads.sqlite.

 

One solution is to install two separate portable versions of Firefox and give one the old downloads.* and the other the new downloads.*

Then I can click a new download in "New" FF and copy the download page,

and paste that into the address bar of the "Old" FF and launch a fresh download.

That will update the old downloads.* with information on where I got it from.

Minor disadvantage - the download date will be wrong.

Major disadvantage - I am retired and life is too short to waste repeatedly click-clacking 60 times between browser for 60 (and rising) new files.

 

Without a much easier solution than the above I am resigned to loss of data.

 

Regards

Alan

Link to comment
Share on other sites

Thanks

 

Certainly its compare capability might help me see differences and possibly understand the problems.

Not so sure about the Hex Editor utility for editing "BLOB DATA".

I have a concept of a Blob as a spoonful of jam that fell on the floor.

I think my ability to understand and edit Blob Data would probably match my capabilities with the registry MUI Cache :wacko:

 

Last night I had a new thought on how to fix my problem, I will give that a whirl first before I burn out my brain cells :rolleyes:

 

Regards

Alan

Link to comment
Share on other sites

  • 3 weeks later...

SOLVED

 

I was distracted with other issues but have now fixed the problem with DOS.

 

The Firefox Addon SQLITE Manager can export and import both *.SQL and *.CSV files, but is not able to MERGE.

 

The first obstacle is that the tool exports UNIX format, not Windows,

i.e. each line is terminated by <LF> without any <CR>, displaying never-ending rubbish in NotePad.

SOLVED by using Portable METAPAD which handles either format automatically.

 

That shows each line of CSV commences with a index number,

and a SQL is a bit more complex with an extra syntax I prefer not to meddle with.

 

SQLITE Manager can import a CSV but cannot handle any conflict with an imported line re-using the same index number.

I therefore added 200 to the index numbers in the imported CSV and this avoids conflict.

 

The procedure is for SQLITE Manager to select the latest Downloads.sqlite file

and export as CSV with the name U-moz_downloads.csv

(normal default for SQLITE Manager is moz_downloads.csv)

The BAT file below translates Unix U-moz_downloads.csv to Windows W-moz_downloads.csv,

 

Then W-moz_downloads.csv has the index numbers separated and replaced into

T-moz_downloads.csv with the replacements being the originals

moz_downloads.csv with the replacements being 201, 202, 203, etc.

Finally T-moz_downloads.csv is compared with W-moz_downloads.csv,

and so long as separation then replacement of the index numbers has resulted in the same output,

then moz_downloads.csv is deemed fit for purpose.

( I never trust DOS to do anything fit for my purpose ).

 

Then SQLITE Manager selects the earlier Downloads.sqlite file

and imports moz_downloads.csv with index numbers 201, 202, etc.

It is now merged

 

@ECHO OFF
setlocal disableDelayedExpansion

IF #%1==# CALL %0 moz_downloads.csv & EXIT

IF EXIST %1 DEL %1
IF EXIST T-%1 DEL T-%1

MORE U-%1 > W-%1
FC U-%1 W-%1 && SET RESULT=SUCCESS || (
 SET RESULT=SUSPECT PROBLEM
 ECHO "FC" thinks Windows has corruptly converted a UNIX format file to Windows Format
 ECHO I have never know conversion to fail - only the "FC" utility has failed so far.
 ECHO IF the output above shows visibly identical matching lines then "FC" is wrong again.
)
ECHO %RESULT% Converting UNIX U-%1 to Windows W-%1 & ECHO(

SET N=200
for /f "usebackq tokens=1* delims=," %%d in ("W-%1") do (
 ECHO %%d,%%e>> T-%1
 SET /A N+=1
 set "ln=%%e"
 setlocal enableDelayedExpansion
 ECHO !N!,!ln!>> %1
 endlocal
)

FC W-%1 T-%1 && SET RESULT=SUCCESS || (SET RESULT=ERROR & ECHO DISASTER & PAUSE)
ECHO %RESULT%TRANSLATING W-%1 to %1 & ECHO(

echo Closing down NOW
PAUSE

 

Regards

Alan

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.