Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Use case: I often have to deal with bad input data from my managers - malformed XML, CSV or other text files. I have to maually edit them into a usable format, which I normally do using a combination of Notepad++ and, in the more complex cases, Python.

What I'd like the most would be a Notepad++ plugin, which would allow me to manipulate the text in Python, taking care of the boilerplate surrounding it.
The plugin could, for example, load the text of the currently opened document into a file-like object ready for manipulation, and provide a second file-like object to write output to. The output would then be displayed in a different tab in NP++.

Is there any such tool? [How do I find it/what should I be looking for? I don't insist on using Notepad++ or Python.] Or should I approach the problem from some completely different angle?

Edit - clarification: I'm not looking for XML-, CSV- or any other format-specific tool or approach. I'm just asking about text processing in general. (Thanks to everone who tried, though.)

share|improve this question

migrated from serverfault.com Jun 6 '12 at 14:08

This question came from our site for professional system and network administrators.

    
Not a plugin, but Augeas comes to mind. –  EEAA Jun 6 '12 at 13:47
    
There is nearly no tool suitable for parsing malformed XML. Python's CSV module might handle some malformed csv text if not horribly mangled. Failing that, tell (request) of your supervisor to give you better (or up to spec) data in order to get your job done effectively. Garbage in, garbage out. –  PenguinCoder Jun 6 '12 at 14:12
    
@ErikA I disagree. I've stated what problem I have and am asking for either where/how to find a tool, or what other approach to try. I'm not just asking for a recommendation, even though that would still be appreciated. –  ver Jun 6 '12 at 15:35
    
@PenguinCoder Tanks for the tips. I didn't want CSV- or XML-specific tools though, just text processing. And as for the second part - that was the first thing I tried, of course. Some people just don't get that giving you invalid testing data in invalid formats can, in fact, really slow you down. :) –  ver Jun 6 '12 at 15:36

2 Answers 2

XML and HTML lookalikes, depending on who you ask, sometimes don't fit into the definiton of text files, but for all other varieties (anything that isn't markup in < >) I've found Vim with my scripts always good enough to handle the task.

Apart from that, Perl and Python come naturally as solutions, depending on who you ask, and what camp he's from. I prefer Perl.

share|improve this answer
up vote 0 down vote accepted

I found a solution - two plugins for Notepad++, Python Script and PyNPP. I wrote an example about it on my blog.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.