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

  • Home
  • SEARCH
  • 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 8025073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:02:59+00:00 2026-06-04T23:02:59+00:00

I have to huge array of 2D-points and some small associated data to file.

  • 0

I have to huge array of 2D-points and some small associated data to file. File will be used by third person and user would like to use this file as input to his program. So user needs to parse file’s contents in his program.

I’d like to use file format that is kind of readable and self-documenting like XML. But using XML for this will make the file at least 3 times larger.

So is there a common way to write such data so that users could easily understand it?

Note that there is a couple of entries of additional data that are more complex than 2D-points.

Any suggestions will be appreciated.

EDIT: The question is not how to parse file but how to write file so that it could be parsed intuitively.

EDIT 2: To be more specific: I’m writing simple emulator of 3D-scene with N points and N cameras, so for each time moment I need to store 2D-projection of each point for each camera. Of course, camera position and orientation need to be stored in the same file.

  • 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-04T23:03:01+00:00Added an answer on June 4, 2026 at 11:03 pm

    You can read line by line and use a regex to check whether there is a 2D coordinate or other kind of information on that line, and use it in your program.


    EDIT:

    I would suggest an input file like the following:

    2
    c 1
    p (x,y)
    o 180
    8
    (x,y)
    (x,y)
    (x,y)
    (x,y)
    (x,y)
    (x,y)
    (x,y)
    (x,y)
    c 2
    p (x,y)
    o 270
    2
    (x,y)
    (x,y)
    

    Where:

    • The first number is the number of camera’s
    • For each camera there is:
      • The camera id
      • The coordinates of the camera
      • The number of points for that camera
      • The coordinates

    It should be easy to read this, because you define the number of points per camera. With StringTokenizer (in Java at least), you can easily split the strings, to get the data you want.

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

Sidebar

Related Questions

I have a huge global array of structures. Some regions of the array are
I have a huge text file which I want to explode into an array.
I have an config.php file where I simply make an huge array that contains
I have a huge array of 2D points (about 3 millions of pairs), which
I have a huge array of points to draw on a canvas. Right now
I have a cpp file that contains a huge array. I get a fatal
I have a huge array, which I loop with a foreach. foreach ($items as
So basically I have a huge array of arrays (only a 2-d array)... My
I have huge amount of data from database, i need to get or store
I have huge data which is static. I need to save it within the

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.