|
The data I need to parse looks like:
[fild1, filed2, .... filedn] , [filed1, filed2, .... filedn]
I call it a special form of CSV data because there are two kinds of comma:
those commas outside the [] pair are served as the separator between different...
Started by Haiyuan Zhang on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Go to CPAN to download..
=~ / \[ ([^\[\]]*) \] ,? /xg;
you can also try out Text::CSV or Text::CSV_XS.
|
|
Hi,
I have a large .csv file (~26000 rows). I want to be able to read it into matlab. Another problem is that it contains a collection of strings delimited by commas in one of the fields.
I'm having trouble reading it. I tried stuff like tdfread, which...
Answer Snippets (Read the full thread at stackoverflow):
How would ANY program know....
If the text of the CSV contains commas, then nothing you can do will help you.
You have a problem because you're reading it in as a .csv, and you have commas within your data separation of fields.
|
|
I have a large csv file with a mix of character and numeric columns. Some of the numerical values are expressed as strings with commas. e.g., "1,513" instead of 1513. What is the simplest way to read the data into R?
I can use read.csv(...,colClasses=...
Started by Rob Hyndman on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Then remove only those the commas.
, 1,234,567, rrr"
Can use readLines on a textConnection.
|
Ask your Facebook Friends
|
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...
Started by Brad on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
The commas with something else, however:
$field = str_replace(',','#COMMA#',$row['Field']); $csv_output ("""")"
Note that this is very, very close to the question Dealing with commas in a CSV file
Check out that is....
|
|
I want to generate a CSV file for user to use Excel to open it.
If I want to escape the comma in values, I can write it as "640,480".
If I want to keep the leading zeros, I can use ="001234".
But if I want to keep both comma and leading zeros in the value...
Started by Darkthread on
, 6 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Also, A warning from experience:
$rawdata = '001,002'; $equation = "=\"$rawdata\"... .
CSV Specification says that , is permitted inside quote strings.
Do
"""001,002"""
I found this out by typing "001,002" and then doing save-as CSV in Excel.
|
|
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 ",...
Started by Bob The Janitor on
, 12 posts
by 12 people.
Answer Snippets (Read the full thread at stackoverflow):
The ....
There's actually a spec for CSV format and how to handle commas:
http it on embedded device.
Values with commas will have be stripped or or kept.
Be able to create a spreadsheet of the values, and save it as a CSV.
|
|
I have a string vaguely like this:
foo,bar,c;qual="baz,blurb",d;junk="quux,syzygy"
that I want to split by commas -- but I need to ignore commas in quotes. How can I do this? Seems like a regexp approach fails; I suppose I can manually scan and enter ...
Started by Jason S on
, 10 posts
by 10 people.
Answer Snippets (Read the full thread at stackoverflow):
For parsing CSV files which have commas embedded in fields enclosed in double quote marks - specifically="baz,blurb" > d;junk="quux,syzygy"
In other words: split on the comma only if that comma has contain escaped quotes....
|
|
Hi,
I have been passed a csv file which is just a lod of numbers with commas between then
e.g.
1,2,3,4,5,6
etc.
There are no crlf's after the commas so I can't import this into excel or a database to further process.
Does anyone know how I can process...
Started by Steve on
, 6 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
I haven't tested we are basically passing each ....
Is now in $2 etc), this works for us because the bat file will ignore commas in command line arguments (per For loop man page), Note we are also replacing the comma since it was ignored.
|
|
I'm having some problems getting a CSV parsing program to work, because one of the fields contains text that is sometimes (but not always) separated by commas.
A line from my CSV file would look like this:
10844,"Urea Nitrogen-Urine, 24hr",UreaUr24
The...
Started by MedX172 on
, 5 posts
by 4 people.
Answer Snippets (Read the full thread at autohotkey):
Here is an example the CSV file, using excel to change all of the commas within the field to "*", then saving as a CSVnot tested....
: : If this parameter is CSV, InputVar will be parsed in standard comma separated value format.
|
|
I have a function that exports values into a CSV file, but the "comments" field has commas in it and it messes up the columns when you open it in a spreadsheet program.
Is there a way around exporting it properly?
//this exports only names and comments...
Started by Brad on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
To do is enclose values in quotes, like so:
"value","value","value"
This will correctly handle commas to be represented as
"some value","Bobby says, ""Hi!""","Some other value"
You can do this with:
$csv field than can contain embedded ....
|