csv

Using CSV as a mutable database?

Yes, this is as stupid a situation as it sounds like. Due to some extremely annoying hosting restrictions and unresponsive tech support, I have to use a CSV file as a database. While I can use MySQL with PHP, I can't use it with the Python backend of my program because of install issues with the host. I can't use SQLite with PHP bec...

How do I do an SQL join with a CSV file in php (drupal specifically)?

Hey guys, here is my problem. I am writing a Drupal module. A user uploads a CSV list of e-mail addresses to a server in a form. I need to do a JOIN on my database to get a list of unique addresses from the CSV file and the DB (No, it is not for spam :). How would I turn the uploaded CSV file into a format that I can do an SQL join on i...

upload data from .csv with multiple worksheets

can anyone please tell me how to upload the data from a .csv file on to a webpage which has 4 worksheets with different number of coloums and rows data. ...

How to best insert 350,000 rows with ADO.Net

I have a csv file with 350,000 rows, each row has about 150 columns. What would be the best way to insert these rows into SQL Server using ADO.Net? The way I've usually done it is to create the SQL statement manually. I was wondering if there is any way I can code it to simply insert the entire datatable into SQL Server? Or some shor...

How can I separate tokens in Java when there are some null tokens

i have line in .csv file as abc,bcc, i have to separate it into three tokens as abc bcc and null first i had try stringTokenizer but it will not return null token so after that i try string.split(",") but it will not return the last null string it will return string which has null in between but not at last so please help me tha...

POI: Importing CSV data.

How can I efficiently import CSV data with Apache POI? If I have a very large CSV file that I would like to store in my Excel spreadsheet, then I don't imagine that going cell-by-cell is the best way to import...? ...

PHP: How can I get rid of commas inside double quotes in a multiple column row?

I need a PHP solution to get rid of commas inside double quotes. I can't seem to figure out a solution using preg_replace. I'm inserting data into a database from a text file that is coma delimited. Certain columns from the text file contain multiple words that are surrounded in double quotes. Theses double quotes have comas inside, so...

VBA: How do you prevent a QueryTable from refreshing?

I wrote a macro that imports a CSV file into my spreadsheet, using a QueryTable. My goal is to import the CSV data and be able to save it in the spreadsheet for future reference. However, the QueryTable updates with the external CSV file, of course, and I would like to prevent this (because I want to forget about the external file). ...

force excel to stop applying "auto-corrections" to csv import data

NOTE: this question is almost a dupe of: http://stackoverflow.com/questions/284092/stop-ms-excel-auto-formatting-numeric-strings-as-numbers I say "almost" because this specific question was not asked ... Question: Is there a way to attach a "schema" to a CSV file, prior to Excel import, that allows Excel to understand the correct form...

Can you refactor out a common functionality from these two methods?

I have two methods that basically converts underlying checkboxes' text or tag as CSV strings. These two methods GetSelectedTextAsCsv() GetTagAsCsv() differ only by which property to extract value from SelectedCheckBoxes, which is of type IList<CheckBox> public string GetSelectedTextAsCsv() { var buffer = new StringB...

Parse Delimited CSV in .NET

I have a text file that is in a comma separated format, delimited by " on most fields. I am trying to get that into something I can enumerate through (Generic Collection, for example). I don't have control over how the file is output nor the character it uses for the delimiter. In this case, the fields are separated by a comma and tex...

How do I count the number of rows in a large CSV file with Perl?

I have to use Perl on a Windows environment at work, and I need to be able to find out the number of rows that a large csv file contains (about 1.4Gb). Any idea how to do this with minimum waste of resources? Thanks PS This must be done within the Perl script and we're not allowed to install any new modules onto the system. ...

Why csv.reader is not pythonic?

I started to use the csv.reader in Python 2.6 but you can't use len on it, or slice it, etc. What's the reason behind this? It certainly feels very limiting. Or is this just an abandoned module in later versions? ...

How should I detect which delimiter is used in a text file?

I need to be able to parse both CSV and TSV files. I can't rely on the users to know the difference, so I would like to avoid asking the user to select the type. Is there a simple way to detect which delimiter is in use? One way would be to read in every line and count both tabs and commas and find out which is most consistently used in...

SSRS 2005: Change column display from item column value/one row to something else?

I have a table/dataset like: 1/1/2009 | Training 1 | Mike 1/1/2009 | Training 1 | Bill 1/1/2009 | Training 1 | Steve I would like to display as 1/1/2009 | Training 1 Mike, Bill, Steve The idea is that the resulting printed page space is not wasted by printing one column on most of the page down but shortening the space to either a...

T-SQL Split string into many-to-one relationship?

I have the following SQL script: DECLARE @temp table ( ID int IDENTITY(1, 1), data nvarchar(100) ) INSERT INTO @temp (data) VALUES ('a,b,c') INSERT INTO @temp (data) VALUES ('d,e,f') SELECT * FROM @temp AS T INNER JOIN (SELECT * FROM dbo.__StringSplit(T.data, ',', T.ID)) AS S ON T.ID = S.RefID And on ...

Dealing with commas in a CSV file

I am looking for suggestions on how to handle a csv file that is being created, then uploaded by our customers, and that may have a comma in a value, like a company name. Some of the ideas we are looking at are: quoted Identifiers (value "," values ","etc) or using a | instead of a comma. The biggest problem is that we have to make it ...

Need to export string w/ commas in it properly into a csv file

EDIT: Copied wrong part of function into this question, below is the appropriate one. $values = mysql_query("SELECT lname, fname, email, dtelephone, etelephone, contactwhen, thursday, friday, saturday, sunday, monday, comments FROM volunteers_2009 WHERE venue_id = $venue_id"); while ($rowr = mysql_fetch_row($values)) { for ($j=0;$...

CSV + Dropdownlist column association

Hullo to all! This question is more about a shortcut than anything: Is there a simple, yet efficient way to associate column names to csv data? Problem: I need to associate column names (and bind them) to import the csv file correctly to my SQL Server database. I don't know before I see the csv what column of the csv will contain what...

Parsing CSV file with un-escaped quotation marks and commas in .NET

I was wondering if someone could help me. I have to parse data from a csv file and put this into a db table. An example of the data is as follows: "first field", "second , field", "third " Field " ", "fourth field" As you can see there are quotation marks and commas embedded in the fields. I was using ADO.NET but it had issues with t...