Jump to content

This may be the wrong section, I've got an SQL file, I'm looking to open it and Copy all results from certain tables. For regular .txt files I use EmEditor, but for .SQL I'm struggling to find a program where I can copy over 2,00,000 results (program not responding) I tried using: DB Browser for SQL Lite. 

 

Happy to answer any questions, just need to export all results from individual tables, basically.

Link to comment
https://linustechtips.com/topic/684061-sql-file/
Share on other sites

Link to post
Share on other sites

I'm not sure if this is a useful solution to your problem, but depending on how the data is set up and organized, you might be able to use `grep` (https://www.gnu.org/software/grep/manual/grep.html) to grab what you want from each table.

 

Ensure a job for life: https://github.com/Droogans/unmaintainable-code

Actual comment I found in legacy code: // WARNING! SQL injection here!

Link to comment
https://linustechtips.com/topic/684061-sql-file/#findComment-8788407
Share on other sites

Link to post
Share on other sites

Just now, LucidMew said:

I'm not sure if this is a useful solution to your problem, but depending on how the data is set up and organized, you might be able to use `grep` (https://www.gnu.org/software/grep/manual/grep.html) to grab what you want from each table.

 

I understand the concept of Grepping, but I don't think you can grep a full-table, and usually it's only specific words (to my understanding). I may be incorrect, I'm just needing a Program which has the capability to process millions of words in an .SQL file, to be short. 

 

Thanks for your reply.

Link to comment
https://linustechtips.com/topic/684061-sql-file/#findComment-8788410
Share on other sites

Link to post
Share on other sites

are you on linux, mac or Winblows?

are you using mySQL, oracle, MS-SQL?

What is your goal with this data? e.g. making graphs

You should be able to do what you want using your database's CLI but would help if we knew what it was. Each database has a GUI designed for it. MySQL has several GUIs to choose from but the CLI is the best.

 

I only really have the following crappy instruction for you: use mySQL from https://www.mysql.com

 

             ☼

ψ ︿_____︿_ψ_   

Link to comment
https://linustechtips.com/topic/684061-sql-file/#findComment-8788417
Share on other sites

Link to post
Share on other sites

1 minute ago, PCHelp2015 said:

I understand the concept of Grepping, but I don't think you can grep a full-table, and usually it's only specific words (to my understanding). I may be incorrect, I'm just needing a Program which has the capability to process millions of words in an .SQL file, to be short. 

 

Thanks for your reply.

I still don't understand. Is the data you want inside the SQL file? and isn't it plain ASCII text in there? or do you want a program to query a database and put the results into a file for later use?

Ensure a job for life: https://github.com/Droogans/unmaintainable-code

Actual comment I found in legacy code: // WARNING! SQL injection here!

Link to comment
https://linustechtips.com/topic/684061-sql-file/#findComment-8788423
Share on other sites

Link to post
Share on other sites

Just now, SCHISCHKA said:

are you on linux, mac or Winblows?

are you using mySQL, oracle, MS-SQL?

What is your goal with this data? e.g. making graphs

You should be able to do what you want using your database's CLI but would help if we knew what it was. Each database has a GUI designed for it. MySQL has several GUIs to choose from but the CLI is the best.

 

I only really have the following crappy instruction for you: use mySQL from https://www.mysql.com

 

Windows.

Not sure what the second questions means, no knowledge with SQL.

My goal is simply to extract the necessary data, not much need to elaborate.

Is MySQL simillar to that Lite Browser I used? Can I simply open up the SQL file I have?

Link to comment
https://linustechtips.com/topic/684061-sql-file/#findComment-8788425
Share on other sites

Link to post
Share on other sites

1 minute ago, LucidMew said:

I still don't understand. Is the data you want inside the SQL file? and isn't it plain ASCII text in there? or do you want a program to query a database and put the results into a file for later use?

My file is called "Database.SQLite3"

If I open as Binary (ASCII / Hexadecimal View) with a .txt editor, it looks like this:

jrOAgi4.png

 

(this picture is a small portion of the content). When opening in SQL Lite Browser, everything is categorized neatly and accordingly in tables. I can't copy and paste all results from 1 specific table as the program crashes. Imagine trying to open up a 10gb file with Notepad. It simply wouldn't work, and your PC would crash. 

 

Link to comment
https://linustechtips.com/topic/684061-sql-file/#findComment-8788431
Share on other sites

Link to post
Share on other sites

1 minute ago, PCHelp2015 said:

My file is called "Database.SQLite3"

If I open as Binary (ASCII / Hexadecimal View) with a .txt editor, it looks like this:

jrOAgi4.png

 

(this picture is a small portion of the content). When opening in SQL Lite Browser, everything is categorized neatly and accordingly in tables. I can't copy and paste all results from 1 specific table as the program crashes. Imagine trying to open up a 10gb file with Notepad. It simply wouldn't work, and your PC would crash. 

 

ohhh... yeah that's the actual database that you need to query.

 

the whole purpose of a database is not to manually search through it all to find what you need. I don't know how much data "necessary data" actually is, but if it's just a subset of the database then you can write a query and the database will perform its magic and spit out a result.

Ensure a job for life: https://github.com/Droogans/unmaintainable-code

Actual comment I found in legacy code: // WARNING! SQL injection here!

Link to comment
https://linustechtips.com/topic/684061-sql-file/#findComment-8788440
Share on other sites

Link to post
Share on other sites

you need to install a database software like MySQL or SQLite and you need to learn the SQL language to extract the data you want.

This is the best place to learn http://www.w3schools.com/sql/default.asp

             ☼

ψ ︿_____︿_ψ_   

Link to comment
https://linustechtips.com/topic/684061-sql-file/#findComment-8788451
Share on other sites

Link to post
Share on other sites

It's a SQLite database. SQLite is a special database where everything is contained in a single file, unlike regular databases which are usually more complex and for which typically need to have a database server installed and running (Mysql , Postgresql etc)

 

I initially thought you had an export of a mysql database , which would have been basically a sequence of sql commands that would recreate the database and insert the information into a database. You would use the import features of those particular database servers to load the data and then you could search and edit it.

 

You can open the database with software like SQLiteBrowser (free, but simple) or commercial tools like SQLite Expert : http://www.sqliteexpert.com (the personal version is free) 

Link to comment
https://linustechtips.com/topic/684061-sql-file/#findComment-8788898
Share on other sites

Link to post
Share on other sites

12 hours ago, mariushm said:

I initially thought you had an export of a mysql database , which would have been basically a sequence of sql commands that would recreate the database and insert the information into a database. You would use the import features of those particular database servers to load the data and then you could search and edit it.

I'm pretty sure this is what I have. I need to recreate the database and only save information from a certain column. 

 

Quote

I initially thought you had an export of a mysql database , which would have been basically a sequence of sql commands that would recreate the database and insert the information into a database.

Surely this is the same?

Link to comment
https://linustechtips.com/topic/684061-sql-file/#findComment-8792532
Share on other sites

Link to post
Share on other sites

On 11/1/2016 at 2:46 AM, PCHelp2015 said:

This may be the wrong section, I've got an SQL file, I'm looking to open it and Copy all results from certain tables. For regular .txt files I use EmEditor, but for .SQL I'm struggling to find a program where I can copy over 2,00,000 results (program not responding) I tried using: DB Browser for SQL Lite. 

 

Happy to answer any questions, just need to export all results from individual tables, basically.

You can open SQL files in any text editor.  It's just plain text albeit in SQL syntax.

 

EDIT: If you're using an SQLite database which is different from traditional SQL databases, you can't simply open the file, you will need an export tool.  

Desktop: Intel Core i7-6700K, ASUS Z170-A, ASUS STRIX GTX 1080 Ti, 16GB DDR4 RAM, 512 GB Samsund 840 Pro, Seasonic X series 650W PSU, Fractal Design Define R4, 2x5TB HDD

Hypervisor 1: Intel Xeon E5-2630L, ASRock EPC612D8, 16GB DDR4 ECC RAM, Intel RT3WB080 8-port RAID controller plus expansion card, Norco RPC-4020 case, 20x2TB WD Red HDD

Other spare hypervisors: Dell Poweredge 2950, HP Proliant DL380 G5

Laptops: ThinkPads, lots of ThinkPads

 

Link to comment
https://linustechtips.com/topic/684061-sql-file/#findComment-8796508
Share on other sites

Link to post
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

×