+ Reply to Thread
Results 1 to 8 of 8

Convert JSON to .CSV

  1. #1
    Registered User
    Join Date
    12-13-2023
    Location
    Michigan, USA
    MS-Off Ver
    Microsoft 365 MSO (Version 2311 Build 16.0.17029.20028) 64-bit
    Posts
    13

    Convert JSON to .CSV

    Added spreadsheet showing my desired output from the JSON input. Mostly I need the X and Y data to plot the point data, but the other attributes are important as well.

    I have recovered database information that I am trying to reconnstruct, the data was given in JSON format like this:

    {"layerServerGens":[{"id":0,"serverGen":234091}],"transportType":"esriTransportTypeUrl","responseType":"esriDataChangesResponseTypeEdits","edits":[{"id":0,"features":{"adds":[],"updates":[],"deletes":[{"geometry":{"x":434757.92663790932,"y":2329162.1516300468},"attributes":{"FID":781,"GlobalID_3":"7786EC58-1FDD-448A-9F11-22A52D67FC70","Long":null,"Lat":null,"OWNER":null,"INSTALLATI":null,"COMMENTS":null,"HEIGHT":null,"MATERIAL":null,"STYLE":null,"GLOBALID":null,"NAME":null,"BUILD":null,"STATUS":null,"GlobalID_2":null,"CreationDa":null,"Creator":null,"EditDate":null,"Editor":null,"layer":null,"path":null,"CreationDate":1664812533657,"Creator_1":"admin.wideband","EditDate_1":1664812533657,"Editor_1":"admin.wideband","NODE":null}},{"geometry":{"x":1059115.5835527368,"y":2865797.5113765462},"attributes":{"FID":782,"GlobalID_3":"F83F39EF-F428-4A3A-B494-4FBB9EA5B542","Long":null,"Lat":null,"OWNER":"AMERICAN TOWER","INSTALLATI":null,"COMMENTS":null,"HEIGHT":null,"MATERIAL":null,"STYLE":null,"GLOBALID":null,"NAME":"TOWER-AT","BUILD":null,"STATUS":null,"GlobalID_2":null,"CreationDa":null,"Creator":null,"EditDate":null,"Editor":null,"layer":null,"path":null,"CreationDate":1677264270803,"Creator_1":"rsigns.wideband","EditDate_1":1677264316967,"Editor_1":"rsigns.wideband","NODE":null}}, ...... format repeats and continues on for a long time ....

    I just need to get it into a .CSV format and Excel seems to be a bit confused when I import it. I am wondering if the structure is confusing excel?

    I really only need the "geometry" data (x,y) and in the "attributes" data (FID,GlobalID, etc)

    So something formatted like this:

    geometry_x geometry_y attributes_FID attributes_GlobalID_3 attributes_CreationDate attributes_Creator_1 attributes_EditDate_1 attributes_Editor_1


    Any help or clues would be greatly appreciated.
    Attached Files Attached Files
    Last edited by eltel2910; 06-27-2024 at 11:14 AM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,709

    Re: Convert JSON to .CSV

    Fast answers need clear examples.

    Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands...) and some manually calculated results. For a new thread (1st post), scroll to Manage Attachments, otherwise scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,082

    Re: Convert JSON to .CSV

    With the JSON text in cell A1, you could use this to split it into readable elements:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    From there, I suspect you could use WRAPROWS and/or WRAPCOLS to create "records" and then FILTER or CHOOSEROWS to get the records you want.

    Just thinking out loud
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,082

    Re: Convert JSON to .CSV

    Sample file attached. I don't really follow what your expected output should look like.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-13-2023
    Location
    Michigan, USA
    MS-Off Ver
    Microsoft 365 MSO (Version 2311 Build 16.0.17029.20028) 64-bit
    Posts
    13

    Re: Convert JSON to .CSV

    Hello,

    Here is the desired spreadsheet output from the JSON input. Thank for helping
    Attached Files Attached Files

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,698

    Re: Convert JSON to .CSV

    crossposted: https://www.mrexcel.com/board/thread.../#post-6195400

    Rule 7: Cross-posting Without Telling Us

    Your post does not comply with Rule 7 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this.

    I have added the crosspost reference for you today. Please comply with this and all our rules in the future

    However, if you continue to crosspost, you can expect to have your thread BLOCKED until you update it yourself.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,709

    Re: Convert JSON to .CSV

    Please post a file with sample of the JSON data.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,082

    Re: Convert JSON to .CSV

    @Alan: I might be mistaken but that doesn't look like a cross-post to me. Very old and, much simpler structure, and different data. Might be wrong

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. convert json file to excel
    By MaartenRo in forum Excel General
    Replies: 5
    Last Post: 07-26-2023, 02:59 AM
  2. convert json file to excel
    By MaartenRo in forum Access Tables & Databases
    Replies: 5
    Last Post: 07-26-2023, 02:59 AM
  3. [SOLVED] Convert json to csv
    By hartwith in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-06-2022, 04:02 AM
  4. Convert short VBA code to google sheet Json
    By tagazou in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-14-2020, 07:44 AM
  5. [SOLVED] Vba convert excel to json with additional text
    By chhiew in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-24-2019, 10:14 PM
  6. [SOLVED] Convert jscript JSON flattener to work with VBA ScriptControl
    By JasperD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-03-2018, 11:49 AM
  7. Convert Object to JSON String
    By amartinez988 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-01-2016, 03:41 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1