From: Jochen Schultz on 18 Mar 2010 07:56 > Microsoft managed to basterdise this format > a bit as well, and lets you use tabs, spaces and all sorts of other > characters to delimit data fields. Someone obviously didn't mention to > them that the file type is 'comma separated values'! Or maybe it is because someone told them, that there is data out there, that might contain commas? regards Jochen
From: Paul M Foster on 18 Mar 2010 10:05 On Thu, Mar 18, 2010 at 11:35:33AM +0000, Ashley Sheridan wrote: <snip> > > The .csv format is just a plain text format, so you won't get formatting > or formulas in your 'sheets' (csv is also a sheetless format) but it's > been used for years by many systems for data. > > A lot of database systems will let you import csv files as well, which > is quite convenient, although you will have to make sure the csv uses > commas to delimit the data. Microsoft managed to basterdise this format > a bit as well, and lets you use tabs, spaces and all sorts of other > characters to delimit data fields. Someone obviously didn't mention to > them that the file type is 'comma separated values'! I process a lot of CSV files, and what I typically see is that Excel will enclose fields which might contain commas in quotes. This gets messy. So I finally wrote a C utility which parses the file and yields tab-delimited records without the quotes. Paul -- Paul M. Foster
From: Jochen Schultz on 18 Mar 2010 11:08 AFAIK, there is no real standard out there for CSV file definition and since Microsoft and many others (me too btw) use other chars for field separation in so called CSV files, i think it is a good way to deal with it and let it be how it is (actually i have to look into every CSV file that is going to be exchanged and that has some advantages as well). Btw. who told you to use tripple quotes? http://www.rfc-editor.org/rfc/rfc4180.txt 7. If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote. For example: "aaa","b""bb","ccc" regards Jochen Ashley Sheridan schrieb: > On Thu, 2010-03-18 at 12:56 +0100, Jochen Schultz wrote: >> > Microsoft managed to basterdise this format >> > a bit as well, and lets you use tabs, spaces and all sorts of other >> > characters to delimit data fields. Someone obviously didn't mention to >> > them that the file type is 'comma separated values'! >> >> Or maybe it is because someone told them, that there is data out there, >> that might contain commas? >> >> regards >> Jochen > > The csv format allows for quote marks which can serve to escape commas: > > "data, with commas" > > And for escaping quote marks, you just use triple quote marks: > > "some text """with quotes""" " > > Thanks, > Ash > http://www.ashleysheridan.co.uk > >
From: tedd on 18 Mar 2010 11:40 At 11:35 AM +0000 3/18/10, Ashley Sheridan wrote: >The .csv format is just a plain text format, so you won't get formatting >or formulas in your 'sheets' (csv is also a sheetless format) but it's >been used for years by many systems for data. > >A lot of database systems will let you import csv files as well, which >is quite convenient, although you will have to make sure the csv uses >commas to delimit the data. Microsoft managed to basterdise this format >a bit as well, and lets you use tabs, spaces and all sorts of other >characters to delimit data fields. Someone obviously didn't mention to >them that the file type is 'comma separated values'! > >Thanks, >Ash Ash: I remember many years ago I had a problem with M$ version of plain text csv files -- the first cell of each spreadsheet was different than all other cells. It took me a while to discover that difference and build in an exception. I've found that M$ always has a better idea, even if they are the only ones who think so. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com
From: Tommy Pham on 18 Mar 2010 11:57 On Thu, Mar 18, 2010 at 8:40 AM, tedd <tedd.sperling(a)gmail.com> wrote: > At 11:35 AM +0000 3/18/10, Ashley Sheridan wrote: >> >> The .csv format is just a plain text format, so you won't get formatting >> or formulas in your 'sheets' (csv is also a sheetless format) but it's >> been used for years by many systems for data. >> >> A lot of database systems will let you import csv files as well, which >> is quite convenient, although you will have to make sure the csv uses >> commas to delimit the data. Microsoft managed to basterdise this format >> a bit as well, and lets you use tabs, spaces and all sorts of other >> characters to delimit data fields. Someone obviously didn't mention to >> them that the file type is 'comma separated values'! >> >> Thanks, >> Ash > > Ash: > > I remember many years ago I had a problem with M$ version of plain text csv > files -- the first cell of each spreadsheet was different than all other > cells. It took me a while to discover that difference and build in an > exception. > > I've found that M$ always has a better idea, even if they are the only ones > who think so. > > Cheers, > > tedd > > -- Personally, I find working with fixed widths is best. The text file might be larger but I don't have worry about escaping any type of characters ;) Regards, Tommy
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: Need routine to tell me number of dimensions in array. Next: $_FILE array being truncated |