Protip: Viewing large XML files

There are lots of editors that can view large XML files, such as Visual Studio, Notepad++, UltraEdit and so on.  But all of these have one flaw – they try and do too much in viewing XML.  Things like coloring, expand/collapse widgets and so on.

One of the integration points in my current project is a large XML file (40MB or so), that consists of exactly two lines of text in the file – the XML header and then the actual content.  No matter what XML viewer I chose, it would pretty much barf or never respond.

Instead of viewing the file as XML, I just changed the extension to “.txt” for that file and voila, now any text editor worth a darn can open it.  Sometimes tools do too much to try and help, but there are always ways to fool them.

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

About Jimmy Bogard

I'm a technical architect with Headspring in Austin, TX. I focus on DDD, distributed systems, and any other acronym-centric design/architecture/methodology. I created AutoMapper and am a co-author of the ASP.NET MVC in Action books.
This entry was posted in Tools. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • Patrik

    Have you checked out XML Notepad?

  • Joey

    +1 for XML Notepad

  • Rémi BOURGAREL

    You can’t put some indent in your file, editors don’t like really big line, I put some condition in my code so on debug mode I put indent and I don’t in release mode.

  • http://realfiction.net Frank Quednau

    Reminds me of that funny Skype Web Browser plugin that tries to recognize phone numbers. Imagine my initial surprise when my browser froze as I visited the pi page (http://3.141592653589793238462643383279502884197169399375105820974944592.com) . Had to pull out process explorer to understand that skype was trying to find phone numbers in the first million digits of Pi :)

  • jonnii

    I use GVIM for browsing xml. Handles big files without any problems.

  • Magesh

    Nice trick!!

  • LaptopHeaven

    Have you tried XML Marker?

  • http://www.lostechies.com/members/bogardj/default.aspx bogardj

    I’ve tried XML notepad, but it still was slower than just viewing as text. I think it might be because I was wanting to “view text that happens to be XML” versus “view XML”. Those seem to be two different goals.

  • Jeff

    I used XMLMax to view 500MB XML Files on a past project:

    http://www.xponentsoftware.com/

    They have a trial version also.

  • Kurt Thompson

    Maybe this is not important to your needs, but text editors won’t tell you if the XML is not well-formed,i.e., that it has a syntax error. It could be a missing markup character, an illegal tag name, etc. If you are just viewing, not so big a problem. You just would not want to save it and propagate the errror. Also, Notepad ++ will not show the XML with collapse expand capability if the file is more than about 75 megabytes or so.

  • Tarun Jain

    I routinely view 10GB+ xml files.
    UltraEdit used to be quite good but not any more.

    The best editor I have found is emEditor.
    It is lightning fast.

    Try it. You will not be sorry.

    • mail = malik.imran143

      After searching 2 days i reach at your post and really thankfull to you man

  • Pingback: Working with big XML files « port135.com