Whats the easiest way to write and engine for importing files of common formats?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alex21
    New Member
    • Oct 2008
    • 19

    Whats the easiest way to write and engine for importing files of common formats?

    I am writing an application where data can be gathered from many different places and graphed against other data. However the data from all the different places is coming in different formats such as .csv, .txt and some others i can't recall right now.

    So i am wondering what is the easiest way to allow my program to import the data supplied in these different formats?

    Thanks Alex.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    I would guess the best way to do this is to check the file extension that you are dealing with and implement functionality that imports the data depending on the file extension. I can't think of any other way to do this.

    -Frinny

    Comment

    • alex21
      New Member
      • Oct 2008
      • 19

      #3
      Yeah thats the problem though CSV stands for comma separated but it can also be tab separated and bar separated etc.

      And the ones that come in .txt format are also usually separated by one of the above.

      And some come with a header of some sort specifying a title and data where others do not. Some also specify column headers where others do not.

      But my goal is to make my application be able to manipulate this data for its own use.

      So how would i detect what method to use to read the data?

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        In this case, I think you're going to have to figure out how each source is formatting their data and go from there.

        If it is possible, I would recommend that you request that the data be sent in XML format so that the data being transferred is standardized. It doesn't have to be XML, you could use csv and text files but you have to make sure that they are formatted the same way (that's why I recommended XML).

        -Frinny

        Comment

        • alex21
          New Member
          • Oct 2008
          • 19

          #5
          Strange that most companies don't offer xml, sigh.

          thanks

          Comment

          Working...