csv

How to check XML attribute existence using XSLT.

Hello to all. About week age I asked the question here and got a great help. Now my question has continuation. Originally I had to convert XML into text file. Here's a sample XML file: <DOC xsi:noNamespaceSchemaLocation="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; <DOC_REQUISITES DOC_DATE="2009-04-23" DOC_NO="99999999...

How do quickly search through a .csv file in Python

I'm reading a 6 million entry .csv file with Python, and I want to be able to search through this file for a particular entry. Are there any tricks to search the entire file? Should you read the whole thing into a dictionary or should you perform a search every time? I tried loading it into a dictionary but that took ages so I'm current...

export outlook 2007 mail folder and subfolders to csv

What's the best way to export mail from an Outlook 2007 folder to a CSV file? I would like to include mail messages within subfolders as well. The built in csv exporter does not allow the option to include subfolders but otherwise does exactly what i want. ...

How does Comma separated files work? ...if the text has commas in it..

I never understood this. ...

how can i convert a list of objects to csv

if i have a list of objects called "Car" public class Car { public string Name; public int Year; public string Model; } and i have a list of List and i want to generate a csv file dynamically from this list ...

Export list as .txt (Python)

My Python module has a list that contains all the data I want to save as a .txt file somewhere. The list contains several tuples like so: list = [ ('one', 'two', 'three'), ('four', 'five', 'six')] How do I print the list so each tuple item is separated by a tab and each tuple is separated by a newline? Thanks ...

java derby database batch load from CSV

Does derby have any capabilities from performing a batch insert of data from a CSV? The best I could come up with was to read in the file line by line and create a batch sql update statement and run that. For 1 million rows that took between 30-40 minutes, as compared with using mySQL's LOAD statement to load from a csv file which took 2...

Parsing CSV file in Windows Server 2008 64 C#

Hi all.. I'm having some trouble parsing a *.CSV file in windows server 2008 64bit version. The problem it that Jet OLEDB 4.0 doesn't read the header row, presented in the CSV. That means, that when I try to access one of the columns like this: DataTable tbl = GetCsvData(); string sd = tbl.Rows[0]["id"].ToString(); The program throw...

How can I store the result of a SQL query in a CSV file using Squirrel?

Version 3.0.3. It's a fairly large result-set, around 3 million rows. ...

Efficiently reading a csv file with windows newline on linux in Python

The following is working under windows for reading csv files line by line. f = open(filename, 'r') for line in f: Though when copying the csv file to a linux server, it fails. It should be mentioned that performance is an issue as the csv files are huge. I am therefore concerned about the string copying when using things like strip....

How can I write only certain lines of a file in Perl?

I am looking for a way to read an input file and print only select lines to an output file in Perl. The lines I want to print to the output file all begin with xxxx.xxxx.xxxx, where x is an alphanumeric character (the periods are periods, not wildcards). The lines do not all have the same ending, if that makes a difference. I'm thinking ...

Why does DBD::CSV complain about "Loose unescaped quote"?

Hello! Why does reading from __DATA__ work and reading from the file doesn't (Loose unescaped quote)? #!/usr/bin/env perl use warnings; use strict; use 5.010; use DBI; my $table = 'klassik_CD.csv'; print qx(cat $table); print qq{\n"data" or "Enter" : }; chomp( my $aw = <> ); if ( $aw eq 'data' ) { $table = 'te_mp_fi_le.csv'; ...

how to generate a csv file through java code

The java code should generate a csv file from the result of a select query. Say example select * from employee;. The output of the query should be in csv file in the destination path mentioned in the code. Please help. ...

CSVs without quotes not working with fgetcsv

I'm trying to parse CSV files uploaded by the user through PHP, but it's not working properly. I've uploaded several properly formatted CSVs and it worked fine, however; I have many users trying to import CSV files exported from Excel and they are having problems. I've compared the files to mine and noticed that the Excel files all lack...

How to parse a single line csv string without the csv.reader iterator in python?

I have a CSV file that i need to rearrange and renecode. I'd like to run line = line.decode('windows-1250').encode('utf-8') on each line before it's parsed and split by the CSV reader. Or I'd like iterate over lines myself run the re-encoding and use just single line parsing form CSV library but with the same reader instance. Is ther...

Creating MAC CSVs in windows for testing

I have a PHP program that uploads a CSV file and reads through it. We only have PC's in the office, but sometimes our clients have Macs. Is there a way to create a Mac CSV in Windows for testing purposes? ...

How can I extract fields from a CSV file in Perl?

I want to extract a particular fields from a csv file (830k records) and store into hash. Is there any fast and easy way to do in Perl with out using any external methods? How can I achieve that? ...

Best practices for inserting/updating large amount of data in SQL 2008

Hi, I'm building a system for updating large amounts of data through various CSV feeds. Normally I would just loop though each row in the feed, do a select query to check if the item already exists and insert/update an item depending if it exists or not. I feel this method isn't very scalable and could hammer the server on larger fee...

How do I import Spanish into a SQL DB?

So I have some Spanish content saved in Excel, that I am exporting into a .csv format so I can import it from the Firefox sql manager add-on into a .sql db. The problem is that when I import it, whenever there is an accent mark, (or whatever the technical name for those things are) Firefox doesn't recognize it, and accordingly produces a...

csv row reader question

Hi All, I am basic level java programmer. I am working with CSV files. I have a file that has rows and columns as follow col1 col2 col3 row1 row2 row3 I read this file and stored it in a String. I explode string with line break to get every row. I have a variable ArrayList that has some row names. How can I make comparison th...