• 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
  On 02/12/2018 at 23:30, 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.

Expand  

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
  On 02/12/2018 at 23:32, 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.

Expand  

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
  On 02/12/2018 at 23:32, Circaflex said:

converting the data dictionary to an XML for them to validate

Expand  

"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

    • No. 1/10th the cost of a Mac? The Mini starts at 599. What mini-pc costs 1/10th of that? The OS is nothing like macOS. Sure you can make it look like it, but it won’t work anything like it. Applications won’t install, or remove the same. Application compatibility will be different. Managing the OS is completely dissimilar, the biggest common ground will be a few CLI utilities. You can definitely get yourself an inexpensive little setup that has a good Linux distro and be happy. It won’t be 1/10th the cost or essentially a Mac though.
    • Vivaldi 7.4.3684.50 by Razvan Serea Vivaldi is a cross-platform web browser built for – and with – the web. A browser based on the Blink engine (same in Chrome and Chromium) that is fast, but also a browser that is rich in functionality, highly flexible and puts the user first. A browser that is made for you. Vivaldi is produced with love by a founding team of browser pioneers, including former CEO Jon Stephenson von Tetzchner, who co-founded and led Opera Software. Vivaldi’s interface is very customizable. Vivaldi combines simplicity and fashion to create a basic, highly customizable interface that provides everything a internet user could need. The browser allows users to customize the appearance of UI elements such as background color, overall theme, address bar and tab positioning, and start pages. Vivaldi features the ability to "stack" and "tile" tabs, annotate web pages, add notes to bookmarks and much more. Vivaldi 7.4.3684.50 changelog: [Chromium] Update to 136.0.7103.170 [Crash][Mail][JSError] RangeError: Maximum call stack size exceeded (VB-115288) Download: Vivaldi 64-bit | 125.0 MB (Freeware) Download: Vivaldi 32-bit | ARM64 View: Vivaldi Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • I must be doing something right because I feel like I don’t really come across that many cheaters. I’m not saying you don’t, I just must be really lucky.
    • That’s a real shame, he’ll be greatly missed.
  • Recent Achievements

    • Apprentice
      Adrian Williams went up a rank
      Apprentice
    • Reacting Well
      BashOrgRu earned a badge
      Reacting Well
    • Collaborator
      CHUNWEI earned a badge
      Collaborator
    • Apprentice
      Cole Multipass went up a rank
      Apprentice
    • Posting Machine
      David Uzondu earned a badge
      Posting Machine
  • Popular Contributors

    1. 1
      +primortal
      519
    2. 2
      ATLien_0
      260
    3. 3
      +Edouard
      192
    4. 4
      +FloatingFatMan
      178
    5. 5
      snowy owl
      135
  • Tell a friend

    Love Neowin? Tell a friend!