Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7791805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:00:15+00:00 2026-06-01T22:00:15+00:00

I have a JSON file that was converted from a csv and is too

  • 0

I have a JSON file that was converted from a csv and is too big to hand edit. Its’ syntax is one large array I think. The data is from a group of routers and I aim to build router objects. The way the current CSV to JSON file is organized by each row and I want to pick out each router and have an object with router name, the all bandwidth measurements associated with that router.

How would you approach this? I’m attempting to take care of all of this when I iterate through the JSON file and when the router changes, I start a new instance of the router object. I’m a no longer a newb, just a slow learner. So would the next step be to create a router class with js and populate the class with what I pull out of my giant JSON array, or could/should I do with out the handwritten class and create all the objects on the fly? (can I create objects on the fly.

Current JSON (it goes on for pages, each router having a few hundred entries in the csv:

[
   {
        "Router": "RouterID1",
        "TimeStamp": "2012/01/01 06:00:00",
        "transferBytes": "23235",
        "ReceivedBytes":  "29903"
   },
   {
        "Router": "RouterID1",
        "TimeStamp": "2012/01/01 06:05:00",
        "transferBytes": "21235",
        "ReceivedBytes":  "22103"
   }
   {
        "Router": "RouterID2",
        "TimeStamp": "2012/01/01 06:00:00",
        "transferBytes": "23235",
        "ReceivedBytes":  "29903"
   },
   {
        "Router": "RouterID2",
        "TimeStamp": "2012/01/01 06:05:00",
        "transferBytes": "21235",
        "ReceivedBytes":  "22103"
   }
]

@amnotiam: the router types are gauranteed to be adjecent to each other

This might not be valid but here is the structure I think I’m going for:

[
   {
        "Router": "RouterID1"
        "TimeStamp": array of timestamps
        "transferBytes": array of bytes transferred for each timestamp
        "ReceivedBytes":  array of bytes received for each timestamp
   },
   {
        "Router": "RouterID2",
         "TimeStamp": array of timestamps
        "transferBytes": array of bytes transferred for each timestamp
        "ReceivedBytes":  array of bytes received for each timestamp
   }
]

@Bergi I want to make an object for each router with there historical data contained with in the object. Right know I have an object for every time entry. (I think)

@Rick Good call, I will be and will probably ask that question later:)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:00:18+00:00Added an answer on June 1, 2026 at 10:00 pm

    You can really just create the objects on the fly. It’s not going to be any faster to hardcode a set of router objects, and it’s likely you’ll make mistakes by handwriting.

    Take a look at this : http://jsfiddle.net/aSbm6/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large JSON file that contains A LOT of similar code. It's
I have a PHP file that serves up a JSON array populated from a
I have a JSON file that has more name value pairs than I care
I have a PHP file that returns a JSON array. I need to extract
I have this swf (flash) file that provides the json that needs to be
I have an AS 3.0 class that loads a JSON file in using a
I have a php file somejson.php that echos a json encoded array {jsonone:first json,jsontwo:second
I have an XSLT stylesheet that transforms an XML file to JSON format and
I've got a JSON value that has been converted from a JavaScript object using
I have a text file that is formatted like JSON, but in a print/view

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.