csv

Regex to match CSV file nested quotes

Hi, I know this has been discussed a million times. I tried searching through the forums and have seen some close regex expressions and tried to modify them but to no avail. Say there is a line in a csv file like this: "123", 456, "701 "B" Street", 910 Is there an easy regex to detect "B" (since its a non-escaped set of quotes within...

Integration framework for PHP

Please suggest some articles, implementations or other resources that deal with making generic customizable integration interfaces(csv,xml-rpc,soap,custom xml) for existing PHP applications. Thanks! ...

How do you read a csv file into a two dimensional array in BASH?

How do you read a csv file into a two dimensional array in BASH? The script needs to be dynamic enough where it can take csv files with variable number of rows and columns. For example, if I have a csv file that looks like AVERAGE STDEV MAX 17 18 19 or AVERAGE STDEV MAX MIN 17 18 ...

Import CSV to mysql

I have created a database and table. I have also created all the fields i will be needing. I have created 46 fields including 1 that is my ID for the row. The CSV doesn't contain the id field, nor does it contain the headers for the columns. I am new to all of this but have been trying to figure this out. I'm not on here being lazy askin...

Export to csv, string w/ comma in it, splits it up

This code exports data into a csv file, which is opened within Excel. When a string has a comma within it, it messes up the order of the data. I need help modifying my code below to resolve any strings that contain a comma within it, to not to create a new column until after the string. I am assuming it will pass each string within do...

CSV parser with low memory footprint for iPhone

After testing my app with Instruments I realized that the current CSV parser I use has a huge memory footprint. Does anybody have a recommendation for one with a low memory footprint? ...

Extract whole SQL Server database to CSV file

It is possible to extract all tables and rows of each table with one query or software in microsoft sql server? thanks ...

scanf("%d", char*) - char-as-int format string?

What is the format string modifier for char-as-number? I want to read in a number never exceeding 255 (actually much less) into an unsigned char type variable using sscanf. Using the typical char source[] = "x32"; char separator; unsigned char dest; int len; len = sscanf(source,"%c%d",&separator,&dest); // validate and proceed....

excluding a column in csv file with regex

Is there any way to exclude/delete/replace one field from a csv file with some regexp in notepad++? I have a csv file with some data like this: '1','data1','data2','data3','data4','data5','data6','data7','data8','data9', 'data10','data11','data12','data13','data14','data15','data16','data17','data18', 'data19','data20','data21','data22...

Multi-dimensional array parsed from .csv ->commas causing mysql database insert issues

I am using Codeigniter to parse an uploaded csv file (which is a multi-dimensional array) into a database. I have tried everything to parse the comma values correctly, but the "id" column in mysql comes up short, as it reads "text", and not "text,text,text". Help!? *For reference:* print_r($data['csvData']); Array ( [0] ...

Regular Expression for CSV with numbers

I'm looking for some regular expression to help parse my CSV file. The file has lines of number,number number,number Comment I want to skip number,number number,number Ex: 319,5446 564425,87 Text to skip 27,765564 I read each line into a string and I wanted to use some regular express to make sure the line matches the pattern of ...

Triggering CSV download using Javascript?

I have an url /reportcsv that generates a plain text csv with Content-type: text/csv and Content-disposition: attachment; filename=report.csv. I want trigger this csv to be downloaded using Javascript. I'm considering two methods: 1) Setting location.href = /reportcsv 2) Setting an iframe url to /reportcsv Both seem to work in Safari....

Formatting a CSV File that contains HTML for Import to Excel

I would like to export a CSV file from my application for importing into Excel (or any other spreadsheet that supports CSV files). Anyhow, one of the cells in my table have rich content (i.e. HTML) which can, of course, contain commas as well as other HTML characters and formatting. I realize that Excel "can" handle HTML formatted text...

Implementing a Cakephp Model using an Array

The CakePHP Cookbook states that a Model can use a file (csv for example) instead of an actual database table but I couldn't find any implementation for it. I was wondering if it is possible to use an Array of data as a model in CakePHP since I have a fairly static set of data which is important to me in a relationship with another tabl...

How to skip extra lines before the header of a tab delimited delimited file in R

The software I am using produces log files with a variable number of lines of summary information followed by lots of tab delimited data. I am trying to write a function that will read the data from these log files into a data frame ignoring the summary information. The summary information never contains a tab, so the following function ...

convert xml document to comma delimited (CSV) file using xslt stylesheet.

I need some assistance converting an xml document to a CSV file using an xslt stylesheet. I am trying to use the following xsl and I can't seem to get it right. I want my comma delimited file to include column headings, followed by the data. My biggest issues are removing the final comma after the last item and inserting a carriage retur...

How to Practically Split Values from CSV File into MySQL Database

Let's suppose I have the following line in a CSV file (I removed the header row in this example): "500,000",2,50,2,90000 I have a PHP script read the CSV file, break the file into individual lines, and store each line in an array called $linearray. Then, I use a foreach loop to look at each line individually. Within the foreach loop,...

any other data format except 'csv' can upload to gae(google-app-engine)

i can use 'csv' file to upload to gae , and i want to know , can any other data format do this, thanks ...

Powershell: Setting values of a filtered array

Hi All I want to read in a csv file, filter it based on the values of two of the fields and set the value of another field. Here's a simple example of what I'm trying to achieve: c:\somefile.csv contents: firstField,secondField,thirdField 1,2,"somevalue" 2,2,"avalue" 3,1,"somevalue" #Import file into array $csv = Import-Csv c:\somefi...

iPhone Accelerometer > csv > email

Hi all, I'm trying to collect data for a machine learning project I'm working on. What I'd like to do is collect accelerometer data from an iPhone, save it to a csv and email it to myself. My app currently is able to acquire data from the accelerometer, but I'm at a bit of a loss as to how to proceed. First of all, I'd like to acquire...