csv

Using PowerShell to download XML, and save as CSV file?

I'm fairly new to PowerShell, but have a strong C# background. The task I'm trying to accomplish is to download some XML, and then save some of the elements from the XML file in a .csv file. I don't need all the elements from the XML, just a few items. The XML looks something like this: <result> <case> <InputData> <Id>1</I...

sscanf and strings

Hi I'm parsing some CSV data in C for the purposes of a Ruby extension. In order to pull out the data from each row I'm using sscanf as follows: char* line = RSTRING_PTR(arg); double price; double volume_remaining; unsigned int type_id, range, order_id, volume_entered, minimum_volume, duration, station_id, region_id, solar_syst...

.NET writing a delimited text file

I am writing a framework for writing out collections into different formats for a project at my employer. One of the output formats is delimited text files (commonly known as the CSV -- even though CSVs aren't always delimited by a comma). I am using the Microsoft.Jet.OLEDB.4.0 provider via OleDbConnection in ADO.net. For reading this f...

Windows Service non-Unicode Encoding Problem

Hi, I'm working on a simple windows service which reads csv data and transfer the data to ms-sql server. Csv contains non-unicode chars(Ç窺İıÖöÜüĞğ). ODBC doesn't transfer the right endocing. I try the copy data without ODBC, with text reading, encoding doesn't right too. But text encoding is right when I debug the service. Csv read co...

python csv question

Hi all, i'm just testing out the csv component in python, and i am having some trouble with it. I have a fairly standard csv string, and the default options all seems to fit with my test, but the result shouldn't group 1, 2, 3, 4 in a row and 5, 6, 7, 8 in a row? Thanks a lot for any enlightenment provided! Python 2.6.2 (r262:71600,...

Parsing HTML rows into CSV

First off the html row looks like this: <tr class="evenColor"> blahblah TheTextIneed blahblah and ends with </tr> I would show the real html but I am sorry to say don't know how to block it. feels shame Using BeautifulSoup (Python) or any other recommended Screen Scraping/Parsing method I would like to output about 1200 .htm files i...

How can we convert XML file to CSV?

I am having an XML file <?xml version="1.0" encoding="ISO-8859-1"?> <Results> <Row> <COL1></COL1> <COL2>25.00</COL2> <COL3>2009-07-06 15:49:34.984</COL3> <COL4>00001720</COL4> </Row> <Row> <COL1>RJ</COL1> <COL2>26.00</COL2> <COL3>2009-07-06 16:04:16.156</COL3> <COL4>00001729</COL4> ...

Why is the column name from a CSV file different than its DataTable?

Howdy, I'm using an OleDbConnection, OleDbCommand, and OleDbDataReader to read a CSV file into a DataTable. The CSV file uses the first row as a header row. Some of the names in the header have non alphanumeric characters like ( _ . / ). When the system creates the Column names it is transposing the . (period) character into ...

How to best split csv strings in oracle 9i

I want to be able to split csv strings in Oracle 9i I've read the following article http://www.oappssurd.com/2009/03/string-split-in-oracle.html But I didn't understand how to make this work. Here are some of my questions pertaining to it Would this work in Oracle 9i, if not, why not? Is there a better way of going about splitting c...

PHP Class to export data to QuickBooks import format?

Seeing lots of SOAP/RDS stuff, but just want to dump some MySQL data and/or CSV files to IIF/QIF/OFX format and don't want to reinvent the wheel (laziness ensues). ...

Two seemingly identical CSV files, only one works

After updating to php 5.3 one of our systems has developed an interesting bug. It parses csv files and the first step is to show the user what they have uploaded to check it over before confirming. However we have run into a bug where some files upload, but aren't read. The weird thing is if we take the data from those files, copy and p...

Is there a "proper" way to read CSV files

In .net, is there a standard library that should be used to read in csv files? All the samples on the web roll their own csv reader / parser, or use OleDb. It's not a problem using any of these solutions, I was just wondering if there is a generally accepted library (not that I can find), or any other "proper" way to do it? ...

In Perl, how can I write and read CSV file composed from a key and array?

I have a problem to write and read properly a CSV file composed of name(key) and array of values: testarray.csv foo1 ,0,0,0,0,1 foo2 ,1,0,0,0,1 foo3 ,3,4,5,6,7 . . . I need to represent that file as follows: foo# will be the key and the five following numbers will be its array. What is the simple way to conduct that and to recall i...

Can SAS convert CSV files into Binary Format?

The output we need to produce is a standard delimited file but instead of ascii content we need binary. Is this possible using SAS? ...

Parsing CSV files with escaped newlines in Ruby?

How do I parse CSV files with escaped newlines in Ruby? I don't see anything obvious in CSV or FasterCSV. Here is some example input: "foo", "bar" "rah", "baz \ and stuff" "green", "red" In Python, I would do this: csvFile = "foo.csv" csv.register_dialect('blah', escapechar='\\') csvReader = csv.reader(open(csvFile), "blah") ...

Excel to .csv problem

I have an excel file that i need to get into CSV. I export it fine but when I go to import it into a mysql db via phpMyAdmin i get a "Invalid field count in CSV input on line 1.". Problem seems to be that the fields are not enclosed by double quotes. I just migrated to MS Excel 2007 and am not sure how to manipulate the CSV save option...

How can I combine files into one CSV file?

If I have one file FOO_1.txt that contains: FOOA FOOB FOOC FOOD ... and a lots of other files FOO_files.txt. Each of them contains: 1110000000... one line that contain 0 or 1 as the number of FOO1 values (fooa,foob, ...) Now I want to combine them to one file FOO_RES.csv that will have the following format: FOOA,1,0,0,0,0,0,0....

CSV parser in C++

All I need is a good CSV file parser for C++. At this point it can really just be a comma-delimited parser (ie don't worry about escaping new lines and commas). The main need is a line-by-line parser that will return a vector for the next line each time the method is called. I found this article which looks quite promising: http://www...

tsql : best way to update a db table with a csv file

I have a products table in sql server 2005 which needs to be updated by certain fields in a csv file. Both files have a vendor part number which can be linked to where I can update the products.discontined field with another in the csv file. My question is what is the best way to approach this? I've considered creating a odbc conne...

Annoying PhpMyAdmin export feature

I wonder if any other users of PhpMyAdmin for Mysql have come across this niggle? Normally when exporting the results of a sql query, you're given options (eg what format to export in , name of filename etc). However above a certain number of rows, these options are not available and you can only see the sql on the normal window. Obviou...