csv

Converting CSV File to XML in Java

Is there an existing application or library in Java which will allow me to take CSV data and create an XML file? The XML tags would be provided through maybe the first row containing column headings....

How to export data from SQL Server 2005 to MySQL

I've been banging my head against SQL Server 2005 trying to get a lot of data out. I've been given a database with nearly 300 tables in it and I need to turn this into a MySQL database. My first call was to use bcp but unfortunately it doesn't produce valid CSV - strings aren't encapsulated so you can't deal with any row that has a str...

CSV File Imports in .Net

I realize this is a newbie question, but I'm looking for a simple solution - it seems like there should be one. What's the best way to import a CSV file into a strongly-typed data structure? Again simple = better. Thanks....

What is a good web-based Grid that accepts Excel clipboard data?

Any good recommendations for a platform agnostic (i.e. Javascript) grid control/plugin that will accept pasted Excel data and can emit Excel-compliant clipboard data during a Copy? I believe Excel data is formatted as CSV during "normal" clipboard operations....

CSV string handling

Typical way of creating a CSV string (pseudocode): create a CSV container object (like a StringBuilder in C#) Loop through the strings you want to add appending a comma after each one After the loop, remove that last superfluous comma. Code sample: public string ReturnAsCSV(ContactList contactList) { StringBuilder sb...

FileHelpers performance

Does anybody has some comments of performance of Filehelpers ? EDIT: Maybe some experience from day life usage ? @omaxx: what was toal size of your file?...

Split a string ignoring quoted sections

Given a string like this: a,"string, with",various,"values, and some",quoted What is a good algorithm to split this based on commas while ignoring the commas inside the quoted sections? The output should be an array: [ "a", "string, with", "various", "values, and some", "quoted" ] ...

Generate Insert SQL statements from a csv file

I need to import a csv file into Firebird and I've spent a couple of hours trying out some tools and none fit my needs. The main problem is that all the tools I've been trying like EMS Data Import and Firebird Data Wizard expect that my csv file contains all the information needed by my Table. I need to write some custom SQL in the ins...

CSV (or sheet in XLS) to SQL create (and insert) statements with .Net?

Does anyone have a technique for generating SQL table create (and data insert) commands pragmatically from a CSV (or sheet in a .xls) file? I've got a third party database system which I'd like to populate with data from a csv file (or sheet in a xls file) but the importer supplied can't create the table structure automatically as it ...

Parsing XML using unix terminal

Sometimes I need to quickly extract some arbitrary data from XML files to put into a CSV format. What's your best practices for doing this in the Unix terminal? I would love some code examples, so for instance how can I get the following problem solved? Example XML input: <root> <myel name="Foo" /> <myel name="Bar" /> </root> My desi...

Java code to import CSV into Access

I posted the code below to the Sun developers forum since I thought it was erroring (the true error was before this code was even hit). One of the responses I got said it would not work and to throw it away. But it is actually working. It might not be the best code (I am new to Java) but is there something inherently "wrong" with it? ...

SSIS: Adding a constant column value when doing a CSV to SQL conversion

I am reading in CSV file and translating it to a SQl Table. The kicker is that one of the columns in the table is a type ID that needs to be set to a constant (in this case 2). I am not sure how to do this. ...

How do I best generate a CSV (comma-delimited text file) for download with ASP.NET?

This is what I've got. It works. But, is there a simpler or better way? One an ASPX page, I've got the download link... <asp:HyperLink ID="HyperLinkDownload" runat="server" NavigateUrl="~/Download.aspx">Download as CSV file</asp:HyperLink> And then I've got the Download.aspx.vb Code Behind... Public Partial Class Download Inheri...

Program for working with large CSV Files

Are there any good programs for dealing with reading large CSV files? Some of the datafiles I deal with are in the 1 GB range. They have too many lines for Excel to even deal with. Using Access can be a little slow, as you have to actually import them into a database to work with them directly. Is there a program that can open large CS...

How do I save each sheet in an Excel workbook to separate CSV files with a macro?

Title says it all. I have an excel with multiple sheets. And I was looking for a macro that will save each sheet to a separate CSV (comma separated file). Excel will not allow you to save all sheets to different CSV files. ...

What's the best way to extract table content from a group of HTML files?

After cleaning a folder full of HTML files with TIDY, how can the tables content be extracted for further processing? ...

asp.net Convert CSV string to string[]

Is there an easy way to convert a string from csv format into a string[] or list? I can guarantee that there are no commas in the data. ...

Import *variable record length* CSV file using SSIS

Has anyone been able to get a variable record length text file (CSV) into SQL Server via SSIS? I have tried time and again to get a CSV file into a SQL Server table, using SSIS, where the input file has varying record lengths. For this question, the two different record lengths are 63 and 326 bytes. All record lengths will be importe...

in rails, how to return records as a csv file

I have a simple database table called "Entries": class CreateEntries < ActiveRecord::Migration def self.up create_table :entries do |t| t.string :firstName t.string :lastName #etc. t.timestamps end end def self.down drop_table :entries end end How do I write a handler that will return the c...

csv api for java

Hi everyone, Can anyone recommend a simple API that will allow me to use read a csv input file, do some simple transformations, and then write it. A quick google has found http://flatpack.sourceforge.net/ which looks promising. I just wanted to check what others are using before I couple myself to this api. thanks, David. ...