Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to open a 750 mb database,sql file?
#18
(08-21-2011, 03:13 AM)WhosYourDaddy Wrote: It won't be easy to import it nor open it with any text editor, but if he wants to check it out, he will need to take any action.

Notepad++ won't even actually load a file that large though, it will reject it entirely with a message box prompting you that the file is too large. So I personally don't think you can do anything with text editors. Unless you try an editor like UltraEdit, which is another advanced editor i've had in the past, but it's not free, and I didn't find it to be as good as Notepad++
I set up a powershell script for you to test out, this should get the contents after a little while of waiting.

Code:
# -- Script Snippet Created By Ace
cls;$_Output = [System.IO.File]::ReadAllLines("PLACE FULL FILEPATH HERE")
write-host $_Output -foregroundcolor "green"
clear-variable _Output

Make sure to replace "PLACE FULL FILEPATH HERE" with the filepath of the file you want the contents of.

Get-Content was throwing OutOfMemory exceptions for me with a file this large, so I changed it to use the ReadAllLines function in the System.IO namespace for the .net method because I believe it's faster and more efficient. I couldn't just pipeline the information through because that seemed to throw exceptions as well.

If I develop this more I might be able to read and output the first 10 000 bytes to a txt file before clearing the variable and continuing with reading the base input file. That way you'll end up with the original file, outputted into numerous txt files, each a separate portion of the original combined file, so that you don't crash an editor like notepad when you try to read the content in smaller pieces.



Update:
Code:
# -- Script Snippet Created By Ace
#Testfile

cls;$_Output = [System.IO.File]::ReadAllLines("C:\Windows\System32\Drivers\ETC\HOSTS")
foreach ($Ln in $_Output) {
    write-host $Ln -foregroundcolor "magenta"
}
clear-variable _Output



Update 2:
Code:
# -- Script Snippet Created By Ace
#Testfile 2

$InputPath = "FILEPATH TO THE FILE YOU WANT TO READ"
$OutputPath = "C:\OUTPUT_.txt"

cls;$_Output = [System.IO.File]::ReadAllLines($InputPath);$i = 1
foreach ($Ln in $_Output) {
    If ($i -eq 1001) {
        foreach ($Ln in $_Output) {
            $Ln >> $OutputPath
        }
    break
    }
    write-host $Ln -foregroundcolor "magenta";$i += 1
}
clear-variable _Output

Something like this will take the first approx. 1000 lines and output it to a text file in C:\OUTPUT_.txt from the file you read. Just edit the Input and Output variables to the filepaths you want them to read, and output to.
Reply


Messages In This Thread
how to open a 750 mb database,sql file? - by etc - 06-14-2011, 07:02 AM
RE: how to open a 750 mb database,sql file? - by AceInfinity - 08-21-2011, 03:57 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  database problem danjohnson 0 1,172 11-13-2012, 10:56 PM
Last Post: danjohnson
  Database accessing in .NET MikeHenery9 1 1,455 07-14-2012, 06:37 PM
Last Post: 'Snorlax
  Creating and inserting data into a PHP and MySQL Database Peter L 9 4,072 03-24-2012, 10:49 AM
Last Post: Haxalot
  php write to mysqli database haphazard 4 2,043 12-10-2011, 08:28 AM
Last Post: ๖ۣۜмσg тιмєz
  Why not use this to help prevent SQL injection? ★Cooldude★ 29 11,966 06-30-2011, 07:06 AM
Last Post: ControL1

Forum Jump:


Users browsing this thread: 1 Guest(s)