XML Conversion |
Home:XML Conversion:Standards Support:CSV CSV FilesComma Separated Value files (CSV) are one of the most common file exchange formats seen. It is a "flat" format, where typically each row has the same format. Each field, or data item, is separated from the others by a comma, and fields containing commas are quoted. DataDirect XML Converters are high-performance Java and .NET data conversion components that support converting of CSV to XML and XML to CSV. CSV Import and ExportCSV Import/Export is a feature of almost every program that deals with tabular data, from accounting programs like Intuit's Quicken to office programs such as Microsoft Excel. It is a very old format, dating to the earliest days of computing. Even Radio Shack's TRS-80 model I used CSV data in DATA statements. But in spite of the ubiquity of the CSV data format, there is a surprising number of variations in implementations. For this reason, the DataDirect XML Converters implementation offers several switches which can customize the behavior for your specific application. Convert CSV to XMLThe following options are supported in the DataDirect XML Converter CSV converter precisely because they are unspecified in the real world, and vary between applications.
TSV FilesA close cousin to CSV files are TSV, or Tab Separated Value files. These are a common export format from spreadsheets also. There is a separate DataDirect XML Converter for these, but it actually is just the CSV Converter in disguise, since either can be converted to the other by changing the definition of the separator character from comma to tab. CSV Sample FileUse the following sample CSV file for use in trying out DataDirect XML Converters:
CSV File Reading and WritingUsing the above file, a tiny Java, C# or VB.Net program can quickly transform the input CSV to XML, or convert XML to CSV. For example, the following Java program converts the above CSV sample file into XML and writes the output to the console.
This would create the following output (with some parts removed).
XML to CSV
Going from XML to CSV is just as important, and the code is just as small. It takes no special schema, and it doesn't even take XQuery or XSLT. Anything immediately under the root element becomes the rows, and anything under that becomes the values between the commas. In the above example, switching to the ConvertFromXML class and writing the sample XML in would produce the initial CSV file. Just like the EDI converters and other converters in the DataDirect XML Converters suite, CSV (and TSV) converters are fully bidirectional. How To Use CSV FilesCSV files often are used as a bridge between older applications and newer ones. Having a tool that transparently reads and writes CSV format files in your toolbox can be very valuable. So whether you have to merge inventory data coming from an outside vendor into your database or publish a list of financial figures for your accountants, being able to bridge these two worlds is the purpose of the DataDirect XML Converters. You can get started with directly accessing CSV data from your Java or .NET applications by downloading a free trial of DataDirect XML Converters today. |
Simplify CSV to XML conversion with DataDirect XML Converters™Start converting CSV to XML from Java and .NET applications. Visit our online shop to buy now. What's Annual Maintenance?Annual Maintainence can save you a lot of money by providing you with free upgrade(s) to the latest releases of DataDirect XML Converters™. It is the smart choice of businesses and individuals seeking to benefit from the latest software, at the lowest possible price. Get it now! |
|||





