We Found Extra Characters at End of JSON Line

%3CLINGO-SUB%20id%3D%22lingo-sub-137995%22%20slang%3D%22en-US%22%3EWe%20Found%20Extra%20Characters%20at%20End%20of%20JSON%20Line%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-137995%22%20slang%3D%22en-US%22%3E%3CP%3EUsing%20the%20JSON%20files%20provided%20on%20the%20Yelp%20website%2C%20%3CA%20href%3D%22https%3A%2F%2Fwww.yelp.com%2Fdataset%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.yelp.com%2Fdataset%3C%2FA%3E.%26nbsp%3B%20When%20attempting%20to%20connect%20to%20the%20files%20via%20Excel's%20%22Get%20Data%22%20or%20Power%20BI%2C%20and%20error%20message%20appears%20stating%20%22We%20found%20extra%20characters%20at%20end%20of%20JSON%20line.%22%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAttached%20is%20a%20sample%20of%20the%20data.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAny%20ideas%20why%20the%20error%20message%20is%20being%20returned%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThank%20you%20in%20advance!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-137995%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBI%20%26amp%3B%20Data%20Analysis%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPower%20BI%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-138244%22%20slang%3D%22en-US%22%3ERe%3A%20We%20Found%20Extra%20Characters%20at%20End%20of%20JSON%20Line%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-138244%22%20slang%3D%22en-US%22%3E%3CP%3ESergei%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20are%20absolutely%20correct.%3C%2FP%3E%0A%3CP%3EUsed%26nbsp%3BSublime%20Text%20to%20edit%20my%20JSON%20file%20to%20add%20the%20header%20and%20footer%20lines%2C%20plus%20the%20commas%26nbsp%3Bat%20the%20beginning%20of%20each%20new%20line%20as%20you%20suggested.%26nbsp%3B%20I%20then%20attempted%20a%20connection%20to%20the%20edited%20JSON%20file%20via%20Excel.%26nbsp%3B%20This%20time%2C%20success!%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThank%20you!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-138220%22%20slang%3D%22en-US%22%3ERe%3A%20We%20Found%20Extra%20Characters%20at%20End%20of%20JSON%20Line%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-138220%22%20slang%3D%22en-US%22%3E%3CP%3ERon%2C%20I%20guess%20you%20forgot%20to%20separate%20records%20by%20comma.%20Please%20see%20files%20in%20my%20previous%20post.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-138219%22%20slang%3D%22en-US%22%3ERe%3A%20We%20Found%20Extra%20Characters%20at%20End%20of%20JSON%20Line%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-138219%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Ron%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENot%20sure%20about%20conversion%20of%20JSON%20to%20CSV%2C%20perhaps%20that%20also%20could%20help.%20However%2C%20your%20error%20is%20not%20since%20records%20in%20the%20array%20have%20different%20sets%20of%20elements.%20My%20vision%3C%2FP%3E%0A%3CP%3E-%20PQ%20parser%20always%20works%20if%20you%20have%20only%20one%20record%20in%20the%20array%3B%3C%2FP%3E%0A%3CP%3E-%20if%20you%20have%20more%20than%20one%20record%20to%20parse%20JSON%20correctly%20you%20shall%20separate%20records%20in%20the%20array%20by%20comma%20and%20add%20on%20the%20top%20the%20name%20of%20the%20object.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20attached%20archive%20Excel%20file%20parses%20you%20initial%20JSON%20modified%20as%20above.%20You%20only%20have%20to%20expand%20nested%20records%20one%20by%20one.%20If%20some%20elements%20are%20missed%20null%20will%20be%20returned%20in%20related%20column.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%20is%20also%20your%20sample%20with%202%20records%2C%20initial%20one%20and%20updated%20as%20above.%20First%20one%20returns%20extra%20character%20error%2C%20second%20one%20works.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20addition%2C%20if%20generate%20M%20script%20manually%20with%20not-updated%20JSON%20and%20click%20on%20error%20you'll%20see%20it%20points%20on%20the%20first%20after%20character%20of%20the%20second%20record%2C%20doesn't%20matter%20how%20many%20records%20you%20have%20and%20do%20they%20have%20exactly%20the%20same%20structure%20or%20not.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-138189%22%20slang%3D%22en-US%22%3ERe%3A%20We%20Found%20Extra%20Characters%20at%20End%20of%20JSON%20Line%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-138189%22%20slang%3D%22en-US%22%3E%3CP%3EI%20bracketed%20the%20JSON%20text%20with%20a%3C%2FP%3E%0A%3CP%3E%7B%22businesses%22%3A%5B%3C%2FP%3E%0A%3CP%3E...%3C%2FP%3E%0A%3CP%3E%5D%7D%3C%2FP%3E%0A%3CP%3EThe%20same%20MIcrosoft%20Excel%2FPower%20BI%20error%20notice%20was%20displayed%3A%20%22We%20Found%20Extra%20Characters%20at%20End%20of%20JSON%20Line%22.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWithin%20the%20scope%20of%20Microsoft's%20JSON%20parser%20I%20am%20left%20with%20impression%20that%20it%20cannot%20handle%20nested%20levels%20of%20data%20objects.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERon%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-138181%22%20slang%3D%22en-US%22%3ERe%3A%20We%20Found%20Extra%20Characters%20at%20End%20of%20JSON%20Line%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-138181%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Sergei%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20your%20insight%20and%20reply!%26nbsp%3B%20I%20will%20apply%20your%20suggestion%20and%20reply%20back%20on%20the%20results.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%3EI%20was%20looking%20more%20closely%20as%20the%20Business.json%20file's%20content.%26nbsp%3B%20There%20are%20nested%20levels%20of%20data%20(e.g.%20attributes)%20that%20are%20inconsistent%20from%20one%20line%20to%20another.%26nbsp%3B%20For%20instance%20the%20second%20line%20has%20information%20about%20garage%20parking%20which%20the%20first%20line%20does%20not.%26nbsp%3B%20If%20I%20were%20to%20%22guess%22%20what%20the%20error%20message%2C%20%22We%20found%20extra%20characters%20at%20end%20of%20JSON%20line%22%2C%20means%20is%20that%20it%20doesn't%20understand%20what%20to%20do%20with%20the%20extra%20data%20objects%20found%20in%20the%20second%20line%20and%20not%20in%20the%20first.%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3ETo%20test%20this%20theory%20opened%20Business.json%20into%20the%20Notepad%20app.%26nbsp%3B%20I%20then%20deleted%20all%20lines%20after%20the%20fifth%20or%20so%20line%20(see%20attached%20TESTbusiness.json).%26nbsp%3B%20Attempted%20to%20load%20the%20file%20into%20Excel%20and%20Power%20BI%20Desktop.%26nbsp%3B%20Same%20error%20message%20appeared.%26nbsp%3B%20I%20then%20deleted%20all%20lines%20except%20for%20the%20first%20one%20(see%20attached%20TEST2business.json)%26nbsp%3B%20This%20file%20loaded%20just%20fine%2C%20as%20you%20can%20seen%20in%20this%20screen%20shot%3A%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CIMG%20class%3D%22CToWUd%20a6T%22%20src%3D%22https%3A%2F%2Fmail.google.com%2Fmail%2Fu%2F0%2F%3Fui%3D2%26amp%3Bik%3D36e3403e67%26amp%3Bview%3Dfimg%26amp%3Bth%3D1606824e07a867da%26amp%3Battid%3D0.2%26amp%3Bdisp%3Demb%26amp%3Brealattid%3Dii_16067504b49c3822%26amp%3Battbid%3DANGjdJ82drXkWx3-zA9Ts72-mhLAP8-7lA0-IDP4VwwshPACxRZDdr3Hd8tSWXQWwHo7a6MifGIAsBFINYDHR_f0-SaYVrQhwdU-M-uY1Zlf71fv4XVtH0M186riCeE%26amp%3Bsz%3Dw770-h932%26amp%3Bats%3D1513617026582%26amp%3Brm%3D1606824e07a867da%26amp%3Bzw%26amp%3Batsh%3D1%22%20border%3D%220%22%20alt%3D%22Inline%20image%201%22%20width%3D%22385%22%20height%3D%22466%22%20%2F%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EI%20then%20added%20back%20the%20second%20line%20from%20the%20json%20file%20(see%20attached%20TEST3business.json).%26nbsp%3B%20When%20I%20attempted%20to%20load%20this%20file%20the%20error%20message%20returned%3A%3C%2FDIV%3E%0A%3CDIV%3E%3CIMG%20class%3D%22CToWUd%20a6T%22%20src%3D%22https%3A%2F%2Fmail.google.com%2Fmail%2Fu%2F0%2F%3Fui%3D2%26amp%3Bik%3D36e3403e67%26amp%3Bview%3Dfimg%26amp%3Bth%3D1606824e07a867da%26amp%3Battid%3D0.1%26amp%3Bdisp%3Demb%26amp%3Brealattid%3Dii_160675329ae6c95e%26amp%3Battbid%3DANGjdJ9uQzSqYiilrRyubigThVNEseS-4AUFSWrTtwS1EQ0sXUEor-u1ASBXX4gy9gj34UQHURTy_IYu6_sPWlp6qtmxivTlq2vc7WG91jeWJt9hqwG-dzgFmlj0D7M%26amp%3Bsz%3Dw1052-h452%26amp%3Bats%3D1513617026582%26amp%3Brm%3D1606824e07a867da%26amp%3Bzw%26amp%3Batsh%3D1%22%20border%3D%220%22%20alt%3D%22Inline%20image%202%22%20width%3D%22526%22%20height%3D%22226%22%20%2F%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EBased%20upon%20these%20simple%20tests%2C%20what%20have%20we%20learned%3F%26nbsp%3B%20Essentially%20two%20things%3A%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%20%26nbsp%3B1.%20The%20Excel%2FPower%20BI%20JSON%20parser%20cannot%20handle%20lines%20with%20inconsistent%20data%20objects%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%20%26nbsp%3B2.%20A%20JSON%20to%20CSV%20conversion%20wouldn't%20solve%20the%20issue.%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EExcel%2FPower%20BI%20are%20built%20upon%20tabular%20models%20where%20data%20is%20arranged%20in%20nice%20columns%20and%20rows.%26nbsp%3B%20As%20they%20are%20downloaded%20the%20Yelp%20data%20files%20simply%20don't%20fit%20into%20that%20schema.%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EWith%20all%20of%20that%20said%20your%20suggestion%20may%20resolve%20it%20all.%26nbsp%3B%20THANKS!%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3ERon%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-138071%22%20slang%3D%22en-US%22%3ERe%3A%20We%20Found%20Extra%20Characters%20at%20End%20of%20JSON%20Line%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-138071%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Ron%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI'm%20not%20familiar%20with%20JSON%2C%20but%20seen%20what%20the%20issue%20is%20discussed%20not%20first%20time%2C%20e.g.%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FWe-found-extra-characters-at-the-end-of-JSON-input%2Ftd-p%2F20607%2Fpage%2F2%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FWe-found-extra-characters-at-the-end-of-JSON-input%2Ftd-p%2F20607%2Fpage%2F2%3C%2FA%3E%20.%26nbsp%3BPerhaps%20Power%20Query%20parser%20doesn't%20support%20all%20modifications%20of%20JSON%20file.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20validate%20your%20file%20here%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.freeformatter.com%2Fjson-validator.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.freeformatter.com%2Fjson-validator.html%3C%2FA%3E%20it%20returns%20%22%3CSPAN%3EThe%20JSON%20input%20is%20NOT%20valid%20according%20to%20RFC%204627%20(JSON%20specification).%22%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EParser%20starts%20working%20if%20add%20the%20object%20on%20the%20top%20of%20your%20file%20and%20separate%20array%20by%20commas%2C%20e.g.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3E%7B%22businesses%22%3A%5B%0A%7B%22business_id%22%3A%20%22.....%0A%2C%7B%22business_id%22%3A%20%22.....%0A%2C%7B%22business_id%22%3A%20%22.....%0A%5D%7D%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%3EAttached%20file%20is%20parsed%20correctly.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ENo%20practical%20solution%20but%20perhaps%20will%20give%20you%20the%20direction.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1417057%22%20slang%3D%22en-US%22%3ERe%3A%20We%20Found%20Extra%20Characters%20at%20End%20of%20JSON%20Line%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1417057%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20you%20please%20shore%20this%20solution%20in%20pictures%20with%20me.%20i%20am%20facing%20same%20error.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1566096%22%20slang%3D%22en-US%22%3ERe%3A%20We%20Found%20Extra%20Characters%20at%20End%20of%20JSON%20Line%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1566096%22%20slang%3D%22en-US%22%3E%3CP%3EForever%20old%2C%20but%20I%20was%20trying%20to%20ingest%20an%20AWS%20CloudCheckr%20JSON%20into%20Excel%20via%20Power%20Query%20and%20getting%20the%20%22We%20found%20extra%20characters%20at%20the%20end%20of%20JSON%20input.%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFinally%20figured%20out%2C%20with%20the%20help%20of%20%3CA%20href%3D%22https%3A%2F%2Fjsonformatter.org%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fjsonformatter.org%2F%3C%2FA%3E%20that%20some%20data%20was%20provided%20as%20%3CSTRONG%3ETrue%3C%2FSTRONG%3E%26nbsp%3B--%20without%20quotes%2C%20which%20Excel%20PQ%20needed.%20Simple%20find%2Freplacing%20%3CSTRONG%3E%3ATrue%2C%3C%2FSTRONG%3E%20with%20%3CSTRONG%3E%3A%22True%22%2C%3C%2FSTRONG%3E%20did%20the%20trick.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESeriously%2C%20Microsoft%2C%20you%20did%20not%20recognize%20Boolean%20when%20you%20found%20it%3F%20Excel%20would%20have%20had%20no%20problem.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1815321%22%20slang%3D%22en-US%22%3ERe%3A%20We%20Found%20Extra%20Characters%20at%20End%20of%20JSON%20Line%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1815321%22%20slang%3D%22en-US%22%3E%3CP%3EI%20ran%20the%20same%20error%20message%20with%20the%20latest%20Office%20365%20Excel.%20First%20of%20all%2C%20the%20error%20message%20is%20wrong%20since%20the%20%22error%22%20had%20nothing%20to%20do%20with%20the%20%22end%20of%20JSON%20line%22.%26nbsp%3BMy%20JSON%20was%20directly%20out%20of%20Python%203.8%20json.dumps()%20and%20online%20validators%20found%20the%20resulting%20JSON%20file%20compliant%20with%26nbsp%3BRFC%204627.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20issue%20in%20my%20case%20was%20that%20%3CSTRONG%3EExcel%2FPowerBI%20JSON%20import%20cannot%20digest%20%22pretty%20JSON%22%3C%2FSTRONG%3E.%20I%20had%20saved%20the%20JSON%20file%20with%20%22ident%3D4%22%20option%20to%20make%20it%20%22human-readable%22.%20But%20that%20made%20it%20unreadable%20for%20Excel.%20I%20removed%20the%20option%20and%20Excel%20was%20able%20to%20import%20the%20file.%20I%20hope%20it%20helps.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Deleted
Not applicable

Using the JSON files provided on the Yelp website, https://www.yelp.com/dataset.  When attempting to connect to the files via Excel's "Get Data" or Power BI, and error message appears stating "We found extra characters at end of JSON line."

 

Attached is a sample of the data.

 

Any ideas why the error message is being returned?

 

Thank you in advance!

8 Replies

Hi Ron,

 

I'm not familiar with JSON, but seen what the issue is discussed not first time, e.g. https://community.powerbi.com/t5/Desktop/We-found-extra-characters-at-the-end-of-JSON-input/td-p/206... . Perhaps Power Query parser doesn't support all modifications of JSON file.

 

If validate your file here https://www.freeformatter.com/json-validator.html it returns "The JSON input is NOT valid according to RFC 4627 (JSON specification)."

 

Parser starts working if add the object on the top of your file and separate array by commas, e.g.

{"businesses":[
{"business_id": ".....
,{"business_id": ".....
,{"business_id": ".....
]}

Attached file is parsed correctly.

No practical solution but perhaps will give you the direction.

 

 

Hi Sergei,

 

Thank you for your insight and reply!  I will apply your suggestion and reply back on the results.

 

I was looking more closely as the Business.json file's content.  There are nested levels of data (e.g. attributes) that are inconsistent from one line to another.  For instance the second line has information about garage parking which the first line does not.  If I were to "guess" what the error message, "We found extra characters at end of JSON line", means is that it doesn't understand what to do with the extra data objects found in the second line and not in the first.
 
To test this theory opened Business.json into the Notepad app.  I then deleted all lines after the fifth or so line (see attached TESTbusiness.json).  Attempted to load the file into Excel and Power BI Desktop.  Same error message appeared.  I then deleted all lines except for the first one (see attached TEST2business.json)  This file loaded just fine, as you can seen in this screen shot:
 
Inline image 1
 
I then added back the second line from the json file (see attached TEST3business.json).  When I attempted to load this file the error message returned:
Inline image 2
 
Based upon these simple tests, what have we learned?  Essentially two things:
   1. The Excel/Power BI JSON parser cannot handle lines with inconsistent data objects
   2. A JSON to CSV conversion wouldn't solve the issue.
 
Excel/Power BI are built upon tabular models where data is arranged in nice columns and rows.  As they are downloaded the Yelp data files simply don't fit into that schema.
 
With all of that said your suggestion may resolve it all.  THANKS!
 
Ron

I bracketed the JSON text with a

{"businesses":[

...

]}

The same MIcrosoft Excel/Power BI error notice was displayed: "We Found Extra Characters at End of JSON Line".

 

Within the scope of Microsoft's JSON parser I am left with impression that it cannot handle nested levels of data objects.

 

Ron

 

Hi Ron,

 

Not sure about conversion of JSON to CSV, perhaps that also could help. However, your error is not since records in the array have different sets of elements. My vision

- PQ parser always works if you have only one record in the array;

- if you have more than one record to parse JSON correctly you shall separate records in the array by comma and add on the top the name of the object.

 

In the attached archive Excel file parses you initial JSON modified as above. You only have to expand nested records one by one. If some elements are missed null will be returned in related column.

 

Here is also your sample with 2 records, initial one and updated as above. First one returns extra character error, second one works.

 

In addition, if generate M script manually with not-updated JSON and click on error you'll see it points on the first after character of the second record, doesn't matter how many records you have and do they have exactly the same structure or not.

Ron, I guess you forgot to separate records by comma. Please see files in my previous post.

Sergei,

 

You are absolutely correct.

Used Sublime Text to edit my JSON file to add the header and footer lines, plus the commas at the beginning of each new line as you suggested.  I then attempted a connection to the edited JSON file via Excel.  This time, success!  

 

Thank you!!

 

Can you please shore this solution in pictures with me. i am facing same error.

Forever old, but I was trying to ingest an AWS CloudCheckr JSON into Excel via Power Query and getting the "We found extra characters at the end of JSON input."

 

Finally figured out, with the help of https://jsonformatter.org/ that some data was provided as True -- without quotes, which Excel PQ needed. Simple find/replacing :True, with :"True", did the trick.

 

Seriously, Microsoft, you did not recognize Boolean when you found it? Excel would have had no problem.