This is what I need to do..

I have a textfile and parse it using awk. The output should be in json format. It should look like this:

```
{
"Record X" : { "Key1":"Value1", "Key2":"Value2"},
"Record Y" : { "Key1":"Value1", "Key2":"Value2"},
"Record Z" : { "Key1":"Value1", "Key2":"Value2"},
"Record A" : { "Key1":"Value1", "Key2":"Value2"}
}

```

Now, this is how the content of textfile looks like:

```
Record X
   Key1 is Value1, Key2 is Value2
Record Y
   Key1 is Value1, Key2 is Value2
Record Z
   Key1 is Value1, Key2 is Value2
Record A
   Key1 is Value1, Key2 is Value2

```

I tried creating a script to produce the output that I want, I'm in the first part however Im already stuck with printing the line. This is my script:

```
 awk 
'BEGIN { print "{" }
      { if($0 ~ /^Record /){print "\"" $0 "\":" }}
 END  { print "}" }' myRecord.txt

```

And the output is this..

```
{
":ecord X
":ecord Y
":ecord Z
":ecord A
}

```

I do not understand why that kind of script will produce something like that. 
Kindly tell me what's wrong. thank you!