Re: Convert Chars Q

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 35888
interpreted = N
texte = The problem is expecting Excel to be consistent! Proper CSV formatting is hard; numerics do not ever have surrounding quotes, but text fields may be surrounded by quotes and embedded quotes are quoted by a variety of means.I would stop using Excel entirely, because it is not suitable for use with a database. Use Access, which has a better export mechanism for CSV (you can define your export format better).John PeacockGary J. Krockover wrote: > > Peter (and Joe), > I wish it was surrounded with quotes...but from the output I get from the > Excel export, it is just: > field1,field2,field3,etc... > > Now, maybe it's my Office settings -or- the proper format for a CSV is to > have each field quoted (thus, you could have a plain comma in a field so > that it doesn't screw up the columns). That makes sense. But when I export > the tab-delimited to CSV and then open the .csv in BBEdit for example, it's > in the format I listed above. I've also been sending Storerunner her > webcat/Excel created .csv's and they've had no problems at all appending the > data to their master database. > > It's no real biggie guys, as I originally said, I was just trying to have > her click one button and then the file is totally done. The way it is now, > she just has to take the webcat created tab-delim file and change comma's to > the ascii equiv and then import-export via Excel. > > If someone has a quick and dirty answer, I'd appreciate it, I also would > appreciate any comments on the original code I first posted, but other than > that, don't worry too much about it :) > > Thanks, > G. > > > on 08.08.2000 3:33, Gary J. Krockover at gkrockover@austin.rr.com wrote: > > > > > Anyways, I just want it to > > > convertchars from a comma to ascii if it finds one in a field so that > when I > > > do import the newly appended .db to Excel for export to CSV, a comma in > her > > > description field for example doesn't become a column seperator. > > > > Isn't CSV this format: > > field1,field2,field3 > > or this > > field1;field2;field3 > > > > Then it might work if you simply surround *any* field with quotes. So you > > should be able to handle quotes within fields also: > > field1;field2 is has quotes inside;field3 > > > > At least this is what I get from clients sometimes... > > Of course, you should convert special chars and semicolons within fields. > > > > > > Peter > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > Web Archive of this list is at: http://search.smithmicro.com/------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Convert Chars Q (John Peacock 2000)
  2. Re: Convert Chars Q (Peter Ostry 2000)
  3. Re: Convert Chars Q (Gary J. Krockover 2000)
  4. Re: Convert Chars Q (Peter Ostry 2000)
  5. Re: Convert Chars Q (Joseph D'Andrea 2000)
  6. Re: Convert Chars Q (Gary J. Krockover 2000)
  7. Re: Convert Chars Q (Joseph D'Andrea 2000)
  8. Re: Convert Chars Q (Gary J. Krockover 2000)
  9. Re: Convert Chars Q (Joseph D'Andrea 2000)
  10. Convert Chars Q (Gary J. Krockover 2000)
The problem is expecting Excel to be consistent! Proper CSV formatting is hard; numerics do not ever have surrounding quotes, but text fields may be surrounded by quotes and embedded quotes are quoted by a variety of means.I would stop using Excel entirely, because it is not suitable for use with a database. Use Access, which has a better export mechanism for CSV (you can define your export format better).John PeacockGary J. Krockover wrote: > > Peter (and Joe), > I wish it was surrounded with quotes...but from the output I get from the > Excel export, it is just: > field1,field2,field3,etc... > > Now, maybe it's my Office settings -or- the proper format for a CSV is to > have each field quoted (thus, you could have a plain comma in a field so > that it doesn't screw up the columns). That makes sense. But when I export > the tab-delimited to CSV and then open the .csv in BBEdit for example, it's > in the format I listed above. I've also been sending Storerunner her > webcat/Excel created .csv's and they've had no problems at all appending the > data to their master database. > > It's no real biggie guys, as I originally said, I was just trying to have > her click one button and then the file is totally done. The way it is now, > she just has to take the webcat created tab-delim file and change comma's to > the ascii equiv and then import-export via Excel. > > If someone has a quick and dirty answer, I'd appreciate it, I also would > appreciate any comments on the original code I first posted, but other than > that, don't worry too much about it :) > > Thanks, > G. > > > on 08.08.2000 3:33, Gary J. Krockover at gkrockover@austin.rr.com wrote: > > > > > Anyways, I just want it to > > > convertchars from a comma to ascii if it finds one in a field so that > when I > > > do import the newly appended .db to Excel for export to CSV, a comma in > her > > > description field for example doesn't become a column seperator. > > > > Isn't CSV this format: > > field1,field2,field3 > > or this > > field1;field2;field3 > > > > Then it might work if you simply surround *any* field with quotes. So you > > should be able to handle quotes within fields also: > > field1;field2 is has quotes inside;field3 > > > > At least this is what I get from clients sometimes... > > Of course, you should convert special chars and semicolons within fields. > > > > > > Peter > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > Web Archive of this list is at: http://search.smithmicro.com/------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ John Peacock

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

WebCatb15 Mac CGI -- [purchase] (1997) [WebDNA] FastCGI version confusion (2011) OFF-TOPIC: Free webdna.net email addresses ... (2003) WC2b15 File Corruption (1997) Paranoid about serial numbers...not (1998) [math date] with non-US date format (2000) Cookies (1998) method of payment (1997) Summing a field full of numbers ... (1997) Problems appending to database (1997) RE: [WebDNA] DHL (2008) Errata: WCS Newbie question (1997) [WebDNA] Sorry WebDNA server not running (2014) Here's an example of an applet in a tpl (1997) 2.1 Stuff (1998) Public beta 3 of WebCatalog 4.0 is now available (2000) F3 crashing server (1997) RequiredFields notes ... (1997) Generating Report Totals (1997) too many nested tags ... (1997)