Nov-28-2016, 04:30 PM
Pages: 1 2
Nov-28-2016, 04:32 PM
JUST GOT IT WORKING!
You guys were right about the json file.
This is what it looked like before formatting:
{"zones": [[1, 3], [3, 5], [5, 89]], "weekdays": [1, 2], "ontime": [5, 1]}
And this is what it looks like after formatting:
{
"zones":[
[
1,
3
],
[
3,
5
],
[
5,
89
]
],
"weekdays":[
1,
2
],
"ontime":[
5,
1
]
}
The only problem I see is it worked fine unformatted on a Linux system. But I gues it doesn't matter now because I have it working on Win 10.
Thanks for the pointers folks.
It is working!
After formatting the json file online, it works just fine.
The original file: {"zones": [[1, 3], [3, 5], [5, 89]], "weekdays": [1, 2], "ontime": [5, 1]}
The formatted file:
{
"zones":[
[
1,
3
],
[
3,
5
],
[
5,
89
]
],
"weekdays":[
1,
2
],
"ontime":[
5,
1
]
}
Not sure why the unformatted file works on linux but not win 10, but at least I got it working.
Thanks for the help folks.
You guys were right about the json file.
This is what it looked like before formatting:
{"zones": [[1, 3], [3, 5], [5, 89]], "weekdays": [1, 2], "ontime": [5, 1]}
And this is what it looks like after formatting:
{
"zones":[
[
1,
3
],
[
3,
5
],
[
5,
89
]
],
"weekdays":[
1,
2
],
"ontime":[
5,
1
]
}
The only problem I see is it worked fine unformatted on a Linux system. But I gues it doesn't matter now because I have it working on Win 10.
Thanks for the pointers folks.
It is working!
After formatting the json file online, it works just fine.
The original file: {"zones": [[1, 3], [3, 5], [5, 89]], "weekdays": [1, 2], "ontime": [5, 1]}
The formatted file:
{
"zones":[
[
1,
3
],
[
3,
5
],
[
5,
89
]
],
"weekdays":[
1,
2
],
"ontime":[
5,
1
]
}
Not sure why the unformatted file works on linux but not win 10, but at least I got it working.
Thanks for the help folks.
Nov-28-2016, 04:58 PM
I'm still convinced that the file was empty before, and was simply written due to this attempted workaround. Otherwise, when you tried to print it in between the <>, we would have seen the file.
Nov-28-2016, 06:00 PM
Your json may have a BOM character at the beginning. Check it with a binary editor (or zip it and attach here so that we can check; if you post it as text, this could drop the BOM and we wouldn't see it).
PS: Hazy memory of having similar problems on Windows, because Notepad++ would add BOMsto all UTF-8 files..
PS: Hazy memory of having similar problems on Windows, because Notepad++ would add BOMsto all UTF-8 files..
Nov-28-2016, 06:01 PM
I believe you are correct.
I created another un-formatted json file and it worked.
I know it wasn't empty at first, but perhaps it had some kind of invalid non-printable character at the beginning.
In any case, thanks for your help.
I created another un-formatted json file and it worked.
I know it wasn't empty at first, but perhaps it had some kind of invalid non-printable character at the beginning.
In any case, thanks for your help.
Nov-28-2016, 07:37 PM
(Nov-28-2016, 06:01 PM)PickyBiker Wrote: [ -> ]I know it wasn't empty at first, but perhaps it had some kind of invalid non-printable character at the beginning.How do you know this? In this post, when "<>" is printed, the file clearly does not contain the JSON. It may also have had non-printable character, but there was no JSON in there.
Pages: 1 2