Re: Convert Chars Q

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 35863
interpreted = N
texte = At 8:33 PM 8/7/00, Gary J. Krockover wrote: >No, it does, and I guess my original post was a bit confusing. I'm not >wanting to have it convert the output database from tab-delimited to >CSV...I'll just have her use Excel for that...but if that could be done >also, it would take out the last step! 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.Yeah... I'm trying to cut out that Excel step for you. If I understand the problem, you're only going to Excel so that you can create the CSV.[showif [joeAssumption]=true] You've got this WebCat tab delimited db with a bunch of fields. Let's just call them field1 through field10. Only field2 and field3 have data that might have commas in them. You do a search that finds all the records you want in the tab delimited database and within a [founditems] context, you look in field2 and field3. If there is a comma in there, you surround the field with quote marks changing the value of field2 and/or field3.[take-a-breath]Now since your only choice for database output with webcat is tab delimited, the file that you write out can't be a webcat database, but it can be a plain old file that ends up looking like and acting like a CSV database. You would use writefile or append file for this. [search db=the.db&neSOMETHINGdata=__findall][founditems][showif [field2]^,] [text]field2=[field2]] [/showif][showif [field3]^,] [text]field3=[field3]] [/showif][appendfile file=name.csv][field1],[field2], .....[field10][/append][/founditems][/search] Notice in the above append that the values of the fields are getting written along with the literal comma between each field.Now all you need to do is copy the csv to where ever it has to go and skip the Excel export.You could even make a link to the csv file and have it download into a browser window as text to cut and paste.___Joe___ _________________________________________________ Joseph D'Andrea JoeDan@West21.com WEST21.com Internet services for the 21st Century http://www.west21.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)
At 8:33 PM 8/7/00, Gary J. Krockover wrote: >No, it does, and I guess my original post was a bit confusing. I'm not >wanting to have it convert the output database from tab-delimited to >CSV...I'll just have her use Excel for that...but if that could be done >also, it would take out the last step! 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.Yeah... I'm trying to cut out that Excel step for you. If I understand the problem, you're only going to Excel so that you can create the CSV.[showif [joeAssumption]=true] You've got this WebCat tab delimited db with a bunch of fields. Let's just call them field1 through field10. Only field2 and field3 have data that might have commas in them. You do a search that finds all the records you want in the tab delimited database and within a [founditems] context, you look in field2 and field3. If there is a comma in there, you surround the field with quote marks changing the value of field2 and/or field3.[take-a-breath]Now since your only choice for database output with webcat is tab delimited, the file that you write out can't be a webcat database, but it can be a plain old file that ends up looking like and acting like a CSV database. You would use writefile or append file for this. [search db=the.db&neSOMETHINGdata=__findall][founditems][showif [field2]^,] [text]field2=[field2]] [/showif][showif [field3]^,] [text]field3=[field3]] [/showif][appendfile file=name.csv][field1],[field2], .....[field10][/append][/founditems][/search] Notice in the above append that the values of the fields are getting written along with the literal comma between each field.Now all you need to do is copy the csv to where ever it has to go and skip the Excel export.You could even make a link to the csv file and have it download into a browser window as text to cut and paste.___Joe___ _________________________________________________ Joseph D'Andrea JoeDan@West21.com WEST21.com Internet services for the 21st Century http://www.west21.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/ Joseph D'Andrea

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:

Help! WebCat2 bug (1997) Need relative path explanation (1997) Running 2 two WebCatalog.acgi's (1996) WebMerchant when CC network is down (1998) [Sum] function? (1997) Format all of a sudden doesn't work (1997) Can't load tmpl files (1997) OH MY GOD! (1998) RequiredFields template (1997) creating an email message (1998) Logging purchases (1997) Cookie set browser session. (1998) WCS Newbie question (1997) [WebDNA] problems sorting when using multiple words in the search field (2011) WebCat2b13MacPlugIn - more [date] problems (1997) taxrate - off by 1 cent (1997) [WebDNA] OFF Topic: looking for suggestions/guidance in selling domains (2008) Help name our technology! (1997) URL for Discussion Archive (1997) How to redirect based on price subtotal? (1998)