csv

How to read 'List separator' from OS in Java?

I am writing a CSV exporter in Java that should respect the user's custom settings, especially the "List separator" to use as a delimiter. In Windows, one can set this List separator in Control Panel -> Regional and Language Options -> Regional Options -> Customize I don't know about the other operating systems, but I'm pretty sure t...

CSV parsing in Java - working example..?

Hi, I want to write a program for a school java project to parse some CSV I do not know. I do know the datatype of each column - although I do not know the delimiter. The problem I do not even marginally know how to fix is to parse Date or even DateTime Columns. They can be in one of many formats. I found many libraries but have no cl...

Best practices for iterating over MASSIVE CSV files in PHP ...

Ok, I'll try and keep this short, sweet and to-the-point. We do massive GeoIP updates to our system by uploading a MASSIVE CSV file to our PHP-based CMS. This thing usually has more than 100k records of IP address information. Now, doing a simple import of this data isn't an issue at all, but we have to run checks against our current re...

Excel: How to add double quotes to strings only in CSV file

I want to create a CSV file from Excel in which string values should be in double quotes and date values should be in MM/dd/yyyy format. All the numeric and Boolean values should be without quotes. How would I go about this? ...

Extract Text from CSV file

I have a CSV file that has only 1 column, but has close to 1500 records. I'd like to extract information from each record, e.g., "The sample battery has a Voltage: 11.1V, and capacity: 4500mAh" I'd like to extract out 11.1 and place in another file, i.e., after "voltage: ", before "V". If the record does not have "voltage: ", I would ...

Parse CSV (comma separated values) in Oracle

I'd like to pass a set of record identifiers into an Oracle procedure, using a comma-separated string. I want to place this into a temp table and then join off that in further processing. How would I go about this? Better approaches than CSV's would be great to hear about too. I'm using ODP.Net for data access. ...

Tab Seperated text converted to tabular format with border

I needed to convert a Tab Seperated Text file into a tabular format as follows File content ID<TAB>WorkId<TAB>Date 0<TAB>W-1230699600000<TAB>2008-12-31 1<TAB>W-1233378000000<TAB>2009-01-31 needs to become +--------+-----------------+-------------+ | ID | WorkId | Date | +--------+-----------------+-------------+...

Upload a Massive CSV File to SQL Server Database

Hi, I need to upload a massive (16GB, 65+ million records) CSV file to a single table in a SQL server 2005 database. Does anyone have any pointers on the best way to do this? Details I am currently using a C# console application (.NET framework 2.0) to split the import file into files of 50000 records, then process each file. I uplo...

Oracle how to export query to a text/csv file

Hi, I was wondering how to go about exporting a query from PL/SQL to an text file or csv file. The query I have in mind exports a huge amount of data (about 1 gig). So I'd also like the data split across multiple files; out1.csv out2.csv out3.csv I'd like to be able to decide how many files to split it across. Anyone have any idea ho...

OleDB not supported in 64bit mode?

I've been using Microsoft.Jet.OLEDB.4.0 and Microsoft.ACE.OLEDB.12.0 to read in .csv, .xls, and .xlsx files. I just found out that neither of these technologies are supported in native 64bit mode! I have 2 questions: What is the supported way to programatically read .csv, .xls, and .xlsx files in 64 bit mode. I just can't find answe...

vim & csv file: put header info into a new column

I have a large number of csv files that look like this below: xxxxxxxx xxxxx Shipment,YD564n xxxxxxxxx xxxxx 1,RR1760 2,HI3503 3,HI4084 4,HI1824 I need to make them look like the following: xxxxxxxx xxxxx Shipment,YD564n xxxxxxxxx xxxxx YD564n,1,RR1760 YD564n,2,HI3503 YD564n,3,HI4084 YD564n,4,HI1824 YD564n is a sh...

Simple data storing in Python

I'm looking for a simple solution using Python to store data as a flat file, such that each line is a string representation of an array that can be easily parsed. I'm sure python has library for doing such a task easily but so far all the approaches I have found seemed like it would have been sloppy to get it to work and I'm sure there ...

Refactoring PHP code that outputs csv with formulas

I have some PHP code that is designed to make a spreadsheet with formulas already in it to sum some columns. It seems there should be a much more elegant way to do this than the code below. What are some refactorings or design patterns that could accomplish something like the code below better? <? echo ",Current Milestone,Total Hours,Mi...

How do I concatenate two strings with the Jet.OLEDB.4.0 provider

I'm passing a query to an internal application that runs that query and returns the result, the connection is to a CSV file and I'm connecting with the Provider=Microsoft.Jet.OLEDB.4.0 I'd like to join to strings in to one column but I'm getting an error. Can this be done, does anyone know how to do it? Example of what I'm doing: sel...

Convert multiple rows into one with comma as separator

If I issue SELECT username FROM Users I get this result: username -------- Paul John Mary but what I really need is one row with all the values separated by comma, like this: Paul, John, Mary How do I do this? ...

Convert DataTable to CSV stream

Currently have a DataTable, but wish to stream it to the user via a WebHandler. FileHelpers has CommonEngine.DataTableToCsv(dt, "file.csv"). However it saves it to a file. How can I save it to a stream instead? I know how to do it when I know the columns in advanced or they don't change, but I want to generate the column headings straigh...

c# generated csv file sent via email embedded to bottom of email in lotus note

I am having this weired issue that CSV attachment sent via email using .NET SmtpClient appeared at the bottom of the email rather than attachment in Lotus Note. I just don’t know how to figure it out and I have no access to client computer makes debugging very hard. What are the possible steps I can take and possible gotchas I need to be...

In ASP.NET, how to get the browser to download string content into a file? (C#)

Hi, I would like to create a text file for export/download, like a *.csv, from an ASP.NET application. I know about Response.TransmitFile, but I want to do this without creating and saving a file physically on the server. Is that possible? Has anyone done something like that? ...

Reading a UTF8 CSV file with Python

I am trying to read a CSV file with accented characters with Python (only French and/or Spanish characters). Based on the Python 2.5 documentation for the csvreader (http://docs.python.org/library/csv.html), I came up with the following code to read the CSV file since the csvreader supports only ASCII. def unicode_csv_reader(unicode_csv...

CSV parser/reader for C#?

Hi, is there a good and free implementation of CSV parser available under some liberal licence? Some counterpart of SuperCSV for Java, perhaps a port? ...