Need help extracting data from a corrupt file - sqlite

I have a file located at the following location on my computer:
D:\Pictures\Imported Catalogue\Ojulari-2
I want to be able to extract the data from the (corrupt file) database file into a text file with all the SQL commands needed to recreate the database.
I'm following instructions from the following link, but I seem to be stuck executing the right command line or should I say navigation the the location of the corrupt file using the command line provided (See below)
Link to instructions I am following: http://gerhardstrasse.wordpress.com/2010/08/19/recover-from-a-corrupt-adobe-lightroom-catalog-file/
Command line I am trying to execute:
echo .dump | ./sqlite3 ~/lightroom_catalog.lrcat > ~/lightroom_catalog.sql

Download the sqlite3 command-line shell, and put the .exe file in the same directory as the database.
Open a Windows command-line shell, and go to that directory:
D:
cd "\Pictures\Imported Catalogue\Ojulari-2"
Execute:
sqlite3 MyDatabaseFile .dump > MyDatabase.sql

Related

Can i use unzip session in workflow when the file is a .txt file

I am working on an Informatica workflow and using Teradata Database. The file is a .txt file.
When I run the workflow I get the error message below.
Error opening file [/infa_shared/uss/SrcFiles/vnd_MG//PRx]. Operating system error message [no such file or directory].
I have an unzip session in the sessions.
You can always use a command task to execute the unzip explicitly.
If your file name is PRx.txt, then the command line of the task will be:
unzip /infa_shared/uss/SrcFiles/vnd_MG//PRx.txt
Then in the next connected session, associate the source file with the filename you have extracted from your .txt archive - in your session's mapping setting.

How to get the deb package located directory in preinst

I am creating a .deb package that would run a shell script as preinst.
The shell script needs some input files, which would be available at where I have the .deb package, as below.
Package_located_directory $ >
mydebpackage.deb
inputfile1
inputfile2
I would just transfer all the files to the different machine at any location and install it with dpkg -i mydebpackage.deb
I tried using pwd in the preinst to get the current deb file located directory.
So, I can get the path of the inputfiles from the preinst script.
But if I run pwd from preinst , it is giving me / instead of the package located directory.
Also I tried passing pwd from the PIPE to achieve this, as below,
pwd | dpkg -i mydebpackage.deb
But I do not want to depend on the user input for the path.
Please guide me for getting the current deb package located directory path from inside of preinst script.
it's better to use postinst and modify the file on your system.
for example : Modify the file /etc/test/test.txt in postinst file

The Same Command Works Fine When Executed From Command Prompt

I am trying to create a csv file and zip it from a script. The first part works fine and abc.csv is created (assuming abc is the filename). I am able to see the file by navigating to the path.
After creating the file, I am trying to zip it using the below command
zip abc.zip abc.csv
I am getting the following error
zip warning: name not matched: abc.csv
zip error: Nothing to do! (abc.zip)
If I navigate to the path, I am able to execute zip abc.zip abc.csv without any issues.
Can you please suggest where I am going wrong.

How should I specify path syntactically for sqlite3 in my .bashrc file?

The SQLite folder containing sqlite3.exe is in C:\.
I am trying to add a path to my .bashrc that will allow me to use the sqlite3 command shell from C:\Users\User.
Again, structure is:
C:\Users\User (using Git bash here) and
C:\sqlite\
sqlite3.exe
sqldiff.exe
sqlite3.def
sqlite3.dll
sqlite3_analyzer.exe
I am attempting to use the sqlite3 command shell in Git bash on windows 8.1.
This is what is in my .bashrc file per Janos recommendation:
alias 'subl="C://Program Files/Sublime Text 3/sublime_text.exe"'
PATH=/c/sqlite/:$PATH
Is there possibly anything else missing?

zip command in unix with wildcards

I am trying to zip file which is in the format of Amazon*.xls in unix and also remove the source file after compression.Below is the used command
zip -m Amazon`date +%Y-%m-%d:%H:%M:%S`.zip Amazon*.xls
For the above command i am getting below error
zip I/O error: No such file or directory
zip error: Could not create output file Amazon.zip
PS: GZIP is working fine. I need zip format files.
It is not the zip, it is how your shell deals with expanding/substituting variables. Two lines solution for bash
export mydate=`date +%Y-%m-%d:%H:%M:%S`
zip -m Amazon_$mydate.zip *matrix*
Execute by hand (few secs difference) or better put in a shell script myzipper.sh and just source it.
Use '-p' instead of '-m', if zip files are to be extracted on Windows OS.
export mydate=date +%Y-%m-%d:%H:%M:%S
zip -p Amazon_$mydate.zip matrix

Resources