csv

Ruby: How can I edit the contents of a CSV file?

As a follow up to this question, how can I edit the contents of a CSV file? I ultimately need to replace all instances of something and I need to do that before I open the file for parsing (with FasterCSV). So, using Ruby I need to open, edit, and save the CSV file. ...

is there a limit to the (CSV) filesize that a Python script can read/write?

I will be writing a little Python script tomorrow, to retrieve all the data from an old MS Access database into a CSV file first, and then after some data cleansing, munging etc, I will import the data into a mySQL database on Linux. I intend to use pyodbc to make a connection to the MS Access db. I will be running the initial script in...

Simple Question, how to I create a dynamic CSV - ASP.NET, VB

Howdy, Now I'm a complete newby to .Net and the likes of VB (I'm more of a Ruby/Rails, PHP kinda guy). Anyway I currently have a sub that has a string builder that I'm wish to use as the content of a CSV which I will email later from a webpage. My stringbuilder is creating the content for the CSV but I don't know how to create the CSV ...

error during Adding data through CSV file.

while I am adding details in database through CSV file I am getting error- Access denied for user 'user'@'%' (using password: YES) . I have checked database username and password. even if I add product one by one(without csv) it is workin fine. It means my database connectivity is correct. Do I need to make some change in my database hos...

Is there a C# framework for parsing and validating CSV/XML files uploaded to an ASP.NET site?

I have a product-based website and I'd like to expand the number of file formats/layouts that we accept for inventory uploads. Ideally that would be done using some existing implementation that supports various file formats and assists in validating and allowing user corrections to the uploaded data. Anything giant and "servery" like Bi...

Import csv data into database in Django Admin

I've tried to import a csv file into a database by tweaking the modelform inside the admin doing this: models.py: class Data(models.Model): place = models.ForeignKey(Places) time = models.DateTimeField() data_1 = models.DecimalField(max_digits=3, decimal_places=1) data_2 = models.DecimalField(max_digits=3, decimal_place...

column headers in CSV using fileHelpers library?

hi guys, is there an build-in field attribute in FileHelper library which will add header row in final generated CSV? i have googled and didn't find much info on it. Currently i have this DelimitedFileEngine _engine = new DelimitedFileEngine(T); _engine.WriteStream(HttpContext.Current.Response.Output, dataSource, int.MaxValue); It...

Convert JSON to CSV

Hi, In python I have a complex object hierarchy made of lists and dictionaries. I want to spit it all out to CSV or some other kind of database format. Any answers in Python or Javascript very much appreciated. I understand that one CSV file (or table) can only represent one 'level' of object in my hierarchy, so the solution would need...

CSVWriter not saving data to file - WHY?

Python newbie getting a bit frustrated with the csv module. At this rate, it would have been easier if I wrote the file parser myself, but I want to do things the Pythonic way .... I have written a little python script that should save my data into a CSV file. Here is a snippet of my code: import csv wrtr = csv.writer(open('myfile.cs...

How to add data to the end of a CSV file (Python)

I need to be able to periodically add data to the end of a CSV file. Ideally, I would like to do this without reading the entire file into memory. Is there a way where I can append data to the end of a file?. One solution that occured to me was to simply shell a pipe command from Python, but that seemed too much of an ugly hack. is ther...

Create csv with asp.net and open in excel

I'm using Asp.net to create a csv file that the user can open directly in excel. I want to make it possible to show the download popup and for the user to choose "Open with Excel" and that will open the file in excel. The code to create the csv: Response.Clear(); Response.AddHeader("content-disposition", string.Format("attachment; fil...

Zend viewRenderer->setNeverRender();

Hi, I am basically trying to export from ZEND to csv as described http://stackoverflow.com/questions/1136264/export-csv-in-zend-framework and use the $this->_helper->viewRenderer->setNeverRender(); unfortunately the plugin code is still contained in the csv file. Any clue why? public function indexAction() { $this->_helper->lay...

What am I doing wrong in my Perl script written to parse a CSV file?

I have two scripts in which I'm experimenting with CSV_XS. In the first, I hard-coded everything: source directory, filename, and the csv delimiter I wanted to look for. The script works great. In the second, however, I try to dynamically discover as much as possible. That script seems to run, but it outputs nothing. I'm having trouble...

Excel CSV to Mysql Database

i am planning to get some Data Entry done for the records of Restaurant info which i later want to upload to MySQL table. Is there some kinda rules i need to follow because i read some place that we have to mention some kinda delimiter like , ; etc. not sure how to do that in Excel. Secondly can i use Google Forms which stores question...

C++ Outputting to .CSV Files

So basically i've never worked with CSV files before, but im making a program thats going to be calculating and outputting ALOT of data to files (8 separate files) Basically it's going to do a formula. then output it as something like: (| means seperate column) int | int | int | float | string | int | int | int | float | final_float in...

MS Access 2003/2007 - Import Specification for data import from csv file used in VBA.....validate field names?

I have an import which I made with the wizard, at least far enough just to save the specification. It imports CSV files, with headers, quote text qualifiers, and comma delimited. I then use the import specification in some vba that fires from a button click event. Here are some things I am wondering: So if the fields in the data are ou...

Convert .CSV file into XML file then send to Web Service.

Hi there, I have a .CSV file and was wondering if there is any process on visual studio or visual web developer to convert it into an XML file and then send it to a Web Service? Thanks for your time. ...

Dyanamically selecting which CSV fields are written

I am using FileHelpers to write some data out to a CSV file. FileHelpers is great because it lets me easily format the various fields using the FileHelper converters. Here is an example of a FileHelpers DelimitedRecord: [DelimitedRecord(",")] public class ShippedRecord { public string Customer; #quouted as can contain '...

How two merge several .csv files horizontally with python?

Hey, I've several .csv files (~10) and need to merge them together into a single file horizontally. Each file has the same number of rows (~300) and 4 header lines which are not necessarily identical, but should not be merged (only take the header lines from the first .csv file). The tokens in the lines are comma separated with no space...

PHP file generating CSV, how to correctly output text.

Currently I am working on a PHP script to output a CSV file from entries in a MySQL database. My problem lies in how to correctly output the values. Many of the entries in the MySQL database will contain commas and quotes, which destroy the format of the CSV file if I just plainly print them out to the file. I'm aware that I can surro...