I've never tried, but you may be able to use streaming XML parsing of the 
LibExpat.jl package to parse such a large XML file. 
See https://github.com/amitmurthy/LibExpat.jl#streaming-xml-parsing.

On Tuesday, January 5, 2016 at 11:55:52 PM UTC+9, Brandon Booth wrote:
>
> I'm trying to parse a series of XML files and write selected values to an 
> SQLite database. My code works on smaller files, but crashes when I get to 
> anything above about 1 GB. 
>
> I'm using Atom with the Hydrogen plugin on Julia 0.4.2.
>
> Any suggestions on what is going wrong or alternative approaches?
>
> Thanks.
>
> Brandon
>
>
> using LightXML
>
>
> function iparse(file)  f = open(file)  n = countlines(f)  vals = 
> Array(ASCIIString,n,3)  seekstart(f)  c = 1  while !eof(f)    try      st = 
> parse_string(readline(f))      r = root(st)      l1 = 
> get_elements_by_tagname(r, "firstlevel)
>
>       l2 = find_element(l1[1], "secondlevel")
>
>       vals[c,1] = content(find_element(l2, "thirdlevel1")
>
>       vals[c,2] = content(find_element(l2, "thirdlevel2")
>
>       vals[c,1] = content(find_element(l2, "thirdlevel3")      c += 1    
> catch      nothing    end  end  return vals  close(f)end
>
>

Reply via email to