• 0

CSV to XML Conversion


Question

I've been tasked with converting a CSV file to XML by a colleague, I do not have much experience in this field and I know I more than likely wont have all of the necessary information, but maybe you can help. The file, which I will upload, is a data dictionary  from a program called REDCap. This program is essentially excel on steroids, and is used as a data collection tool at the Hospital I work at. The data dictionary are basically the ID fields from the "database" that is built within the form (this is what captures data from a user). This is the type of data located in the CSV file, headers at the top. My colleague mentioned Altova and mapping the CSV to the XML, but surely looking at this dataset, it is not as complicated as I was originally told and I almost think one of these online converters will do just fine. I have found a few, but I am unsure if there is one that is better than the other? Are there certain standards to be followed when outputting to XML?

xmlcon.PNG

Link to comment
https://www.neowin.net/forum/topic/1377190-csv-to-xml-conversion/
Share on other sites

6 answers to this question

Recommended Posts

  • 0

There are many ways that could be structured as XML. If you've found an online converter that output's something REDCap is happy to absorb then don't worry about it.

 

The only thing I'll mention is that I hope you're not submitting private records to a random online conversion service.

  • 0
2 minutes ago, virtorio said:

There are many ways that could be structured as XML. If you've found an online converter that output's something REDCap is happy to absorb then don't worry about it.

 

The only thing I'll mention is that I hope you're not submitting private records to a random online conversion service.

I appreciate the concern, my REDCap project has no current data, we are still in the stages of finalizing the form for the city. However, the city is who wants the XML file. How this came about is, my colleague was tasked with helping create a digital form, the city used to purchase software to do this but with REDCap being free for non-profits, he figured this would do the trick. The form was created with our own ID's, the city has specific IDs they wanted for other software they use, so we were tasked with recreating the form with the correct IDs, then converting the data dictionary to an XML for them to validate. I have a conference call Wed, to see if they need specific headers or anything, but wanted to be ahead of the game.

  • 0
1 minute ago, Circaflex said:

I appreciate the concern, my REDCap project has no current data, we are still in the stages of finalizing the form for the city. However, the city is who wants the XML file.

Oh yes, sorry I misread that. Anyway, that's the point of XML, is can be structured however you need it to be. Something like this:

<record record_id="xxx" record_id_8736_ce="xxx">
  <date_of_entry>xxx</date_of_entry>
  <country_id>xxx</country_id>
  ...
</record>
<record record_id="xxx" record_id_8736_ce="xxx">
  <date_of_entry>xxx</date_of_entry>
  <country_id>xxx</country_id>
  ...
</record>
<record record_id="xxx" record_id_8736_ce="xxx">
  <date_of_entry>xxx</date_of_entry>
  <country_id>xxx</country_id>
  ...
</record>

Often, you'd put the "unique identifier" of the record as an attribute, and the data in child nodes, like above.

  • 0
2 hours ago, Circaflex said:

converting the data dictionary to an XML for them to validate

"XML" and "Validate" in the same sentence might mean they are looking for an XML Schema file

 

https://en.wikipedia.org/wiki/XML_Schema_(W3C)

 

https://www.w3.org/standards/techs/xmlschema#w3c_all

 

XML is a giant toxic mess and people avoid it like the plague these days, but mostly they use JSON which IMO ends up suffering many of the same issues but at least is not as painful to look at...

 

https://en.wikipedia.org/wiki/JSON

 

https://www.json.org/xml.html

 

 

 

 

 

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I'd say the first one failed to be as popular as Apple anticipated, but the easy adjustment here is to make fewer of them next time around. It would only be a "flop" if it isn't possible for Apple to recover the design and factory tooling costs given the number of units sold, which I doubt would be the case. It isn't like no one bought them; it just failed to become the new hot phone of the year.
    • You're right that it does not follow the plain meaning of the word, but in this context, it is a legal term defined in 49 U.S.C. Kind of how "wire fraud" laws apply even if a physical wire was not used. Given that it is codified in law, and it isn't just automotive journalists that don't understand evolving technology, I highly doubt congress would change a well understood term just because technology makes the term slightly less actuate.
    • This is exactly why I keep saying we are not ready for human free self-driving. These little "bugs" are may seem like random one-offs. There was also the Waymo that drove between police with drawn weapons and the suspect they were pointing them at. From a software perspective it is easy to understand how those extremely rare situations may not have been programed for, but that is the point. If AI needs to be told to watch out for every possible contingency, then it can never be successful. There will always be the possibility of a first encounter that the AI needs to understand to avoid.
    • TeraCopy 4.0 Final by Razvan Serea TeraCopy is a compact program designed to copy and move files at the maximum possible speed, also providing you with a lot of features. Copy files faster. TeraCopy uses dynamically adjusted buffers to reduce seek times. Asynchronous copy speeds up file transfer between two physical hard drives. Pause and resume transfers. Pause copy process at any time to free up system resources and continue with a single click. Error recovery. In case of copy error, TeraCopy will try several times and in the worse case just skips the file, not terminating the entire transfer. Interactive file list. TeraCopy shows failed file transfers and lets you fix the problem and recopy only problem files. Shell integration. TeraCopy can completely replace Explorer copy and move functions, allowing you work with files as usual. TeraCopy is free for non-commercial use only. For commercial use you need to buy a license. The paid version of the program includes the following features: Copy/move to your favorite folders. Save reports as HTML and CSV files. Select files with the same extension/folder. Remove the selected files from the copy queue. Download: TeraCopy 4.0 | 14.6MB (Freeware, paid upgrade available) View: TeraCopy Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • Week One Done
      Eurosoft10 earned a badge
      Week One Done
    • One Month Later
      Eurosoft10 earned a badge
      One Month Later
    • One Year In
      Skeet Campbell earned a badge
      One Year In
    • One Month Later
      Sharbel earned a badge
      One Month Later
    • First Post
      BizSAR earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      586
    2. 2
      +Edouard
      187
    3. 3
      Michael Scrip
      74
    4. 4
      PsYcHoKiLLa
      72
    5. 5
      neufuse
      69
  • Tell a friend

    Love Neowin? Tell a friend!