csv

Formatting csv file data with html template

I have an csv file, the data, and an HTML file, the template. I want a script that will create an individual html file per record from the csv file, using the html file as a template. Which is the best way to do this in Ruby? Python? Is there a tool/library I can use for this in either language? ...

Is there any free tool to convert a file with more than 65000 registers from DBF format to CSV?

Dear all, I need to convert a very large file from DBF format to CSV format. I have tried Microsoft Excel to do the job, but the problem is that I cannot see more than 65500 registers when I open and export the file. Microsoft Access couldn't open the file, too. I have found on google some shareware tools, searching for "DBF to CSV". ...

Advantage to parsing Excel Spreadsheet data vs. CSV?

I have tabulated data in an Excel spreadsheet (file size will likely never be larger than 1 mb). I want to use PHP to parse the data and insert in to a MySQL database. Is there any advantage to keeping the file as an .xls/.xlsx and parsing it using a PHP Excel Parsing Library? If so, what are some good libraries to use? Obviuously,...

How to replace a column using Python's built-in .csv writer module?

I need to do a find and replace (specific to one column of URLs) in a huge Excel .csv file. Since I'm in the beginning stages of trying to teach myself a scripting language, I figured I'd try to implement the solution in python. I'm having trouble with the "replace" part of the solution. I've read the official csv module documentation a...

Writing with Python's built-in .csv module

[Please note that this is a different question from the already answered How to replace a column using Python’s built-in .csv writer module?] I need to do a find and replace (specific to one column of URLs) in a huge Excel .csv file. Since I'm in the beginning stages of trying to teach myself a scripting language, I figured I'd try to i...

Can you please help me in Oracle for writing the table contents in to a file using UTL functions

While writing the SQL procedure for creating a CSV file from the contents of the table, I am stuck at the error below: ERROR at line 1: ORA-29283: invalid file operation ORA-06512: at "SYS.UTL_FILE", line 488 ORA-29283: invalid file operation ORA-06512: at "DSI_DPIPE.BUSSHOURS", line 28 ORA-06512: at "DSI_DPIPE.BUSSHOURS", line 55 ORA-0...

Visual Basic How do I read a CSV file and display the values in a datagrid?

I'm using VB 2005, how do I open a CSV file and read the columns/rows and display the values in a datagrid? CSV file example: jsmith,[email protected] I then want to perform an action on each row i.e. each user, how would I do this? I'm a newbie as you can tell but happy to learn. Thanks ...

Finding incorrectly-formatted email addresses in a CSV file

I've got a CSV file full of contact information and I'm trying to load it into GMail contacts, but the e-mail addresses aren't all correctly formatted so GMail doesn't recognise it as an e-mail field. I can open the CSV file in Excel (Mac) but I don't know if there's a way of pattern matching in Excel. Also, some of the fields may contai...

Using Regex to remove Carriage Returns in a CSV file in Notepad++

I have a CSV file I need to clean up. This is a one-time thing so I'd like to do it in Notepad++ if possible. The CSV file has two fields, one of which is wrapped in quotes. I'd like to remove any Carriage Returns from within the quoted field. I was trying to use this pattern but can't get it quite right... (.*)\"(.*)\n(.*)\"(.*) Als...

How do I handle embedded newlines in CSV files in Perl?

I'm reading a .csv file that was created in Excel with the first line being column headings. One column heading contains an embedded newline. I want to ignore that newline but reading it line-by-line like: while ( <IN> ) { ... } will treat it as a new line which will break my code (which I haven't written yet). My approach wa...

Create a valid CSV with regular expressions

I have a horribly formated, tab delimited, "CSV" that I'm trying to clean up. I would like to quote all the fields; currently only some of them are. I'm trying to go through, tab by tab, and add quotes if necessary. This RegEx will give me all the tabs. \t This RegEx will give me the tabs that do not END with a ". \t(?!") How do ...

SSRS adding a footer row to a table - CSV output

Hi, I have a simple table in SSRS which I am using to create a CSV report. The output looks like: a,b,c 1,2,3 4,5,6 where a,b,c are the column headers. Now my client requires a footer row saying how many records are in the file. However if I add a row to my table with the required fields in, the output becomes: a,b,c,records 1,2,3,2 4,...

Splitting Comma Seperated Values (CSV)

How to split the CSV file in c sharp? And how to display this? ...

MySQL import in phpmyadmin (CSV) chokes on quotes

I am trying to import a .csv file into a MySQL table via phpMyAdmin. The .csv file is separated by pipes, formated like this: data|d'ata|d'a"ta|dat"a| data|"da"ta|data|da't'a| dat'a|data|da"ta"|da'ta| The data contains quotes. I have no control over the format in which I recieve the data -- it is generated by a third party. The pro...

How to read a csv file into a .net datatable

How can I load a csv file into a System.Data.DataTable, creating the datatable based on the CSV file? Is there a class library for this or can I use ADO.net to connect to the file? ...

Reading Comma Delimited Text File to C# DataTable, columns get truncated to 255 characters

We are importing from CSV to SQL. To do so, we are reading the CSV file and writing to a temporary .txt file using a schema.ini. (I'm not sure yet exactly why are are writing to this temporary file, but that's how the code currently works). From there, we are loading a DataTable via OleDB using the following connection string (for ASCII...

Drawing chart using amcharts

Can anyone tell how to use amcharts to display the details of a particular column in a pie/donut chart.I know that it uses an XML but what I have is a CSV file and I have to group them based on a particular column status whose value can be one of the four namely "open" "Close" "In Progress" "Dropped".The CSV looks like this 12345,Harish...

Exporting result of select statement to CSV format in DB2

Is there any way by which we can export the result of a select statment to CSV file, just like in MySQL. MySQL Command; SELECT col1,col2,coln into OUTFILE 'result.csv' FIELDS TERMINATED BY ',' FROM testtable t; ...

pre-apend to a text file

I want to pre-append some text a a CSV file that is created by MySQL. Basically I want to add the header information for the rows so when the user opens it in Excel they know what each column is. Whats the best way to do this. I presume there is some easy linux command that can do this? I can also do it in the PHP script. I'd li...

Linux Tool To Parse CSV files

Is anyone aware of a standalone command line program that can be used to parse CSV files? To do things like: csvparse -c 2,5,6 filename to extract fields from columns 2 5 and 6 from all rows. It should be able to handle the csv file format: http://tools.ietf.org/html/rfc4180 which means quoting fields and escaping inner quotes as app...