JSON parser fix?

43 views
Skip to first unread message

rellevart

unread,
Feb 9, 2012, 5:06:36 PM2/9/12
to Excel Ramblings
Just wanted you to know that I your parser has been very helpful. I
did need to make 2 minor fixes to get it to work for what I'm using.
One was for numbers in non standard notation there's probably a better
way but this worked for me.
While IsNumeric(pointedAt(k)) Or _
pointedAt(k) = "." Or _
pointedAt(k) = "-" Or _
IsNumeric(s & pointedAt(k) & pointedAt(k + 1)) Or _
IsNumeric(s & pointedAt(k) & pointedAt(k + 1) &
pointedAt(k + 2))
s = s & pointedAt(k)
k = k + 1
Wend
The other was for empy values for cases that look like this {}

I added the & "}" to the "{" case

pWhatNext = anyQ & "," & "}"

Thanks again for the great bit of coding. I'm using it to pull jira
records out using the rest api's and charting the results.

Bruce Mcpherson

unread,
Feb 9, 2012, 5:25:13 PM2/9/12
to excel-r...@googlegroups.com

Thanks for taking the time to share your improvement. Can you give an example of the kind of non standard number that was giving the problem so I can understand the changes before incorporating into the released version..bruce

--
You received this message because you are subscribed to the Google Groups "Excel Ramblings" group.
To post to this group, send email to excel-r...@googlegroups.com.
To unsubscribe from this group, send email to excel-ramblin...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/excel-ramblings?hl=en.

rellevart

unread,
Feb 9, 2012, 5:55:11 PM2/9/12
to Excel Ramblings
8E6 or 8E-6 ect. These are valid to be not quoted in json. There are
a couple of other cases that could have this issue decimal notation
possibly.

On Feb 9, 4:25 pm, Bruce Mcpherson <br...@mcpher.com> wrote:
> Thanks for taking the time to share your improvement. Can you give an
> example of the kind of non standard number that was giving the problem so I
> can understand the changes before incorporating into the released
> version..bruce
> >http://groups.google.com/group/excel-ramblings?hl=en.- Hide quoted text -
>
> - Show quoted text -

Bruce Mcpherson

unread,
Feb 10, 2012, 11:02:28 AM2/10/12
to excel-r...@googlegroups.com
ah yes.. got it 

The numeric parsing is indeed still a bit flaky - it misses scientific notation, hex numbers and also allows some invalid combinations of signs and decimal points.

I'll put in a complete generic fix when i get some time. 

In the meantime, thanks for sharing your fix for those notations with the group. I really appreciate your participation.

Bruce

Heath

unread,
May 8, 2013, 4:30:16 PM5/8/13
to excel-r...@googlegroups.com, relle...@gmail.com
Rellevart.

I'm very interested to know how you did with Jira REST queries in Excel.   Would you have anything you could share?
Reply all
Reply to author
Forward
0 new messages