Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: File Format Design for Meta Data and Contents

  1. #1
    Junior Member
    Join Date
    Sep 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question File Format Design for Meta Data and Contents

    Hey all,

    I am currently in duty to design a file format which carries both meta information as well as actual contents.

    The meta information part mainly consists of the following attributes (may be extended):
    1) Function Name
    2) Function Arguments

    The content part is of tabular structure and consists of column header and actual content rows. Both the header definition as well as the contents is all custom and the file format should be flexible enough to support this.

    Example for some content:
    id    name    adresse
    1     miller  somewhere
    2     john    anywhere

    Note: The aim of such a file format is to define a function to be called with the provided tabular contents.

    Question:
    Is an XML format feasible to implement such requirements for meta and actual data contents as described above?
    Or is there anyone that knows of a best practise for such requirements?

    I want to avoid re-inventing the wheel...

    Thank you and Kind Regards,
    Rapthor


  2. #2
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,669
    Thanks
    25
    Thanked 327 Times in 304 Posts

    Default Re: File Format Design for Meta Data and Contents

    Personally, I've found XML to usually be the best course of action. In my experience, it provides a flexible solution where I can add/remove parts of the document format with minimal code change. It also allows good flexibility for "optional" fields, which is always a plus. Lastly, XML reading and writing is included in the standard java api, so you don't "have" to add any additional dependencies to your project (although there are some significantly better XML reading/writing apis than the standard java api one).
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

Similar Threads

  1. Creating a Linked List from the contents of a file
    By greystreet34 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 6th, 2013, 06:59 PM
  2. Replies: 19
    Last Post: March 15th, 2013, 03:11 PM
  3. Read a text file and parse the contents of file
    By HelloAll in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: March 3rd, 2011, 04:47 AM
  4. Reading in entire contents of text file to one string
    By fortune2k in forum File I/O & Other I/O Streams
    Replies: 9
    Last Post: December 12th, 2010, 06:03 PM
  5. Retrieving Meta-Data from a File
    By FretDancer69 in forum File I/O & Other I/O Streams
    Replies: 7
    Last Post: February 9th, 2010, 07:10 AM

Tags for this Thread