csv

Easiest way to combine 'l','e','t','t','e','r','s'? C# / .NET

I have a string similar to 'l','e','t','t','e','r','s' or ('l','e','t','t','e','r','s') I know this should be very easy but i dont know how. I know replacing ' and , with "" is an option since both are illegal characters in the result string but i feel theres a better way to do this. What is the easist way in C# .NET ...

converting csv to xml with an xsd

I am trying to find a reusable way of taking a CSV file and generating an XML file from it that conforms to a specified XSD. I haven't really found a reusable approach for this. I have used Altova MapForce which lets me import a CSV file and XSD, do the mapping than generate code from this, but the code needs to be regenerated whenever t...

How to force scheme.ini to be used for MS Text Driver?

I am creating this huge csv import, that uses the ms text driver, to read the csv file. And I am using ColdFusion to create the scheme.ini in each folder's location, where the file has been uploaded. Here is a sample one I am using: [some_filename.csv] Format=CSVDelimited ColNameHeader=True MaxScanRows=0 Col1=user_id Text width 80 Col...

Selenium RC: how to capture/handle error?

Hi, My test uses Selenium to loop through a CSV list of URLs via an HTTP proxy (working script below). As I watch the script run I can see about 10% of the calls produce "Proxy error: 502" ("Bad_Gateway"); however, the errors are not captured by my catch-all "except Exception" clause -- ie: instead of writing 'error' in the appropriate r...

Is it possible to paste Excel / CSV data from clipboard to DataGridView in C# ?

I use DataGridView control to manage a simple dictionary (several columns and a few hundred rows). DataGridView functionality is almost sufficient. I can add new rows, modify values and copy data from it to Excel. One thing I cannot do is to copy data from Excel to my control. Is it possible with some properties? Or is some code required...

How to Create a CSV file using PHP (and upload it).

For example, I have a variable "$foo" that includes all the data which I want to show in the CSV: $foo = "some value,another value,last value"; My goal is to: Create a CSV file named "some.csv" whose contents are equal to $foo Upload "some.csv" to my server. How can this be done? Update: Here's the exact code that worked for me. ...

Writing a CSV file in .net

I have a requirement to export a dataset as a CSV file. I have spent a while searching for a set of rules to go by and realised there are quite a few rules and exceptions when writing a CSV file. http://knab.ws/blog/index.php?/archives/3-CSV-file-parser-and-writer-in-C-Part-1.html http://bytes.com/topic/c-sharp/answers/236875-problems...

Converting CSV of unknown size to custom Object with C#

I am trying to import a file in from my clients custom software. The file is basically a csv file with some custom escape characters in it. I am reading in the file line by line, then splitting each line into a string[]. I am then assigning each each element to a field in my custom object. For example: Person.Name = line[0]; Person.Age ...

Leading Zero is dropped when converting a csv file to data table using oledb

I have a csv file from which I have to populate different tables in database I am using Microsoft.Jet.OleDb.4.0 to convert csv file to data table from where I proceed forward the problem is when I do this a value such as "0261" is stored as 261, the leading zero is dropped, is there a way to prevent it??? Thanks in advance... ...

Load csv into oleDB and force all inferred datatypes to string

Im trying to load a csv file into a datatable using oledb. This is no problem but unfortunately one of the fields which looks numeric has a string value in about 3% of the fields and so is not being populated. because im converting the csv into xml i really don't care about inferring datatypes and simply need the data in a string as i ...

MySQL command to search CSV (or similar array)

I'm trying to write an SQL query that would search within a CSV (or similar) array in a column. Here's an example: insert into properties set bedrooms = 1,2,3 (or 1-3) title = nice property price = 500 I'd like to then search where bedrooms = 2+. Is this even possible? ...

MFMailComposeViewController csv attachment not being attached, but showing inline instead

Hello - I am having a problem with sending csv attachments via MFMailComposeViewController. Sometimes they come through just fine, but for other users they don't come through as attachments, but rather as text inline in the email (with <br/> instead of line returns.) It's very strange. Anybody know what I'm doing wrong? Here is a snipp...

parse CSV files that contain unicode character using OpenCSV

hi everybody, i parse a .csv file with OpenCSV in netbeans 6.0.1. my file contains some unicode character and when i write it in output the character appears in other form(like (HJ1'-E/;) when i open this file in notepad, it is ok. the code that i used: CSVReader reader=new CSVReader(new FileReader("d:\\a.csv"),',','\'',1); String[...

Repetitively Retrieve Data from Site via PHP

When accessing http://www.example.net, a CSV file is downloaded with the most current data regarding that site. I want to have my site, http://www.example.com, access http://www.example.net on an hour by hour basis in order to get updated information. I want to then use the updated information stored in the CSV file to compare change...

sdf files/database... Is there an efficient way to export to csv

I'm working on a mobile device with a sdf database. I'm wondering if there's a quick easy way to export the table to CSV. Currently the c++ application opens the tables, and walks through it one record at a time and one field at a time, appending to a file. It's ugly and slow and predates my employment. I'm wondering if there is a bet...

How to Transform a String from Multi-Line to Single-Line in PHP?

Is there a PHP string function that transforms a multi-line string into a single-line string? I'm getting some data back from an API that contains multiple lines. For example: <p>Some Data</p> <p>Some more Data</p> <p>Even More Data</p> I assign that data to a variable, then echo the variable as part/"cell" of a CSV document. It's...

PHP - Remove whitespace from within a string.

I get a string from a db, then I remove all the HTML tags, carriage returns and newlines, before I put it in a csv. Only thing is I cant remove the excess white space from between the strings, any ideas? Thanks, Joe ...

csv output format from sqlplus run in a Unix script

I need to format csv output file from a sqlplus query. The char and varchar output fields come out in the max column size in the table, which means a lot of columns have extra blanks, plus the comma seperator. How can I get rid of the extra blanks in my csv file? Also how can I get "" around the numeric fields? ...

Can anyone advice on a simple way to create SQL tables on the fly, using a CSV file upload in a .NET Web App?

Hi, I have checked a few answers but was unable to find specific details on how we can create a SQL table using custom metadata (or Columns from a CSV file) which is uploaded by a user through a CSV file. A feature available with www.dabbledb.com, like creating online database for custom information. It will be a web based .NET applicati...

Update or Delete a Line from CSV using C#

hi, can anyone please help me with this query. I have a CSV file which is used by a unix application as a config file. The file has no header and the first column is unique. This is the format of the file. XXX1,11112009,11112009 XXX2,11112009,11112009 How do i, using C#: 1) update a a whole line 2) Delete a line I tried using...