Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a very large Json file. It contains 27000 records.

a record looks like this:

adlibJSON: {
recordList: {
record: [
@attributes: {
priref: "4372",
created: "2011-12-09T23:09:57",
modification: "2012-08-11T17:07:51",
selected: "False"
}, [
acquisition.method: [
association.person: [
"Backer, Bregitta"
association.subject: [
collection: [
"Backer, collectie"
], ... ...

The problem is that this is not valid Json. The quotes are missing for the names.

Like for example should be "":

I need to edit this big json file and add all the quotation marks, otherwise the file doesn't parse with for example D3.js

What is the best way to repair this Json file?

share|improve this question
Which OS are you using? – Dennis Jan 22 '13 at 20:52
To the migrate voters: I don't think this is off topic. This can be easily fixed by a sed command or something similar. And it's certainly not a programming question, so it's probably off topic for Stack Overflow. – Dennis Jan 22 '13 at 20:54
up vote 2 down vote accepted

This is my solution:

I'd use a decent text editor with regex find and replace capability (e.g., Visual Studio, UltraEdit, etc.).

Then Do: find


and for the names with 2 dots:


and replace with


Or you could use powershell:

$allText = gc yourfile.txt
$allText -replace '^\s*(\w+\.\w+)\s*:', '"$1":'
share|improve this answer

Your Answer


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.