csv

Looking for tool to generate random CSV data

Hello All, I've been Googling fpr a product, but have yet to find something that I like for generating random/semi-random Data. Ideally, I'd be able to use some of my own input lists, combined with email generation, phone number, etc... to be able to generate test CSV files with multiple records. Also, open source is best. What tools ...

When reading a CSV file using a DataReader and the OLEDB Jet data provider, how can I control column data types?

In my C# application I am using the Microsoft Jet OLEDB data provider to read a CSV file. The connection string looks like this: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Data;Extended Properties="text;HDR=Yes;FMT=Delimited I open an ADO.NET OleDbConnection using that connection string and select all the rows from the CSV file w...

How can I join a list into a string (caveat)?

Along the lines of my previous question, how can i join a list of strings into a string such that values get quoted cleanly. Something like: ['a', 'one "two" three', 'foo, bar', """both"'"""] into: a, 'one "two" three', "foo, bar", "both\"'" I suspect that the csv module will come into play here, but i'm not sure how to get the out...

Exporting tab-delimited files in SSRS 2005

In this MSDN article, MS explains how to specify other delimiters besides commas for csv-type exports from SSRS 2005: http://msdn.microsoft.com/en-us/library/ms155365%28SQL.90%29.aspx ...however, literal tab characters are stripped by the config file parser, and it doesn't appear that MS has provided a workaround. This entry on Micros...

C# Exception Handling continue on error

I have a basic C# console application that reads a text file (CSV format) line by line and puts the data into a HashTable. The first CSV item in the line is the key (id num) and the rest of the line is the value. However I've discovered that my import file has a few duplicate keys that it shouldn't have. When I try to import the file the...

What are the merits of CSV and/or JSON and/or XML and/or ??? output in a REST API?

We're currently trying to plan a new developer API for our application and debating the various data formats we should use for interchange. We're also going to be using this API for our official desktop application so we're going to have a working implementation before it goes public. There's a fairly intense discussion going on about ...

.dbc --> .csv

I have a little utility that converts .dbc files to .csv files, trouble is, somewhere in the conversion some data is lost/destroyed/whatever. I input a.dbc into converter, it produces a.csv. I delete a.dbc,and then run a.csv back through the converter, and I come back with a "slightly" different .dbc file then I had started with. Does a...

iSeries Export to CSV

Is there an iSeries command to export the data in a table to CSV format? I know about the Windows utilities, but since this needs to be run automatically I need to run this from a CL program. ...

How can I extract the address information from a Compressed ESRI shapefile datasource?

When I download the zip file from the website it contains files with the following extensions: .dbf .prj .sbn .sbx .shp .shp.xml .shx Is this is a common data file format that I download or purchase a converter? I think this is some kind of mapping data file but I all need are the addresses it contains to push into our existing databas...

Microsoft Excel mangles Diacritics in .csv files?

I am programmatically exporting data (using PHP 5.2) into a .csv test file. Example data: Numéro 1 (note the accented e). The data is utf-8 (no prepended BOM) When I open this file in MS excel is displays as Numéro 1 I am able to open this in a text editor (UltraEdit) which displays it correctly. UE reports the character is decim...

What's the easiest way to import a new table into MySQL v5 from CSV?

I'm running MySQL 5 on a linux server on my local network. Running windows XP for my desktop. Had a look at the MySQL GUI Tools but I dont think they help. I cannot install apache on the remote server & use something like PHPmyAdmin. ...

Exporting MSAccess Tables as Unicode with Tilde delimiter

I want to export the contents of several tables from MSAccess2003. The tables contain unicode Japanese characters. I want to store them as tilde delimited text files. I can do this manually using File/Export and, in the 'Advanced' dialog selecting tilde as Field Delimiter and the Unicode as the Code Page. I can store this as an Export...

CSV file. Excel is automatically converting my text to a date. Bad Excel.

Does anyone happen to know if there is a token I can add to my csv for this field so Excel doesn't try to convert it? I'm trying to write a csv file from my application and one of the values happens to look enough like a date that Excel is automatically converting it from text to a date. I've tried putting all of my text fields (includ...

Using PHP to take the first line of a CSV file and create a MySQL Table with the data

I am trying to take a rather large CSV file and insert it into a MySQL database for referencing in a project. I would like to use the first line of the file to create the table using proper data types and not varchar for each column. The ultimate goal is to automate this process as I have several similar files but the each has different ...

Import Text File into generic Database using SQL

Hi, I am currently trying to import a semi-colon delimited text file into a database in c# using OleDb where I don't know the type (SQL Server, Access, Oracle, MySQL, postgreSQL, etc.) Currently I'm reading in the file as a database using the Jet text reader then creating a prepared insert statement, populating the fields, then commiti...

Regex Partial String CSV Matching

Let me preface this by saying I'm a complete amateur when it comes to RegEx and only started a few days ago. I'm trying to solve a problem formatting a file and have hit a hitch with a particular type of data. The input file is structured like this: Two words,Word,Word,Word,"Number, number" What I need to do is format it like this......

Replacing or Removing a new line with something else but only between single or double quotes using PHP on a CSV file

I have a CSV file that holds about 200,000 - 300,000 records. Most of the records can be separated and inserted into a MySQL database with a simple $line = explode("\n", $fileData); and then the values separated with $lineValues = explode(',', $line); and then inserted into the database using the proper data type i.e int, float, s...

IE6 generated strange worksheet name when doing export from java application

I am encountering error like test(10)[1].csv file cannot be found at C:\Documents and Settings\Ron\Local Settings\Temporary Internet Files\Content.IE5\PQ0STUVW When trying to do export of CSV file using the following codes. Anyone have any idea what could be wrong? This issue does not occur in IE7 / Firefox and is only specific to ...

Get File Object used by a CSV Reader/Writer Object

Is there any way to access the file object used by a CSV writer/reader object after it has been instantiated? I openned up the csv module, and it appears it's contest are builtin. I also tried setting the file object as a property but I get the following error: AttributeError: '_csv.writer' object has no attribute 'fileobj' ...

Can you recommend a Java library for reading (and possibly writing) CSV files?

Can you recommend a Java library for reading, parsing, validating and mapping rows in a comma separated value (CSV) file to Java value objects (JavaBeans)? ...