Solved

Form Return in "Comma-Delimited" Format

Posted on 1997-02-06
1
182 Views
Last Modified: 2013-12-25
I have a script (that I got elsewhere) that returns a Form by E-Mail.  I successfully altered it to also E-Mail me the Form info in a CSV format, so I can easily import it into my contact manager (Maximizer).  My problem is that if there is a comma anywhere in the data, it screws up my import (commas are common in addresses from Quebec or Europe, also in dates ie. July 15, 1997).

Currently the script returns data in this format:  Field,Field,Field

I would like to get a "comma-delimited" format: "Field","Field","Field"

The portion of the script in question is as follows:

open (MAIL, "|$mailprog $youmail") || die "Can't open $mailprog!\n";
print MAIL "$INPUT{'category9'},$INPUT{'name'},$INPUT{'category1'},$INPUT{'category2'},$INPUT{'category3'},$INPUT{'category4'},$INPUT{'category5'},$INPUT{'category6'},$INPUT{'category12'},$INPUT{'category13'},$INPUT{'category14'},$INPUT{'email'},$INPUT{'category8'},Internet Web Site,$INPUT{'category7'},Customer\n";

close (MAIL);


Any suggestions about how to get double quotes (") around the Fields?  Even if the Field is empty I need it returned empty, so my Import macro will work - so an empty field would return: "Field","","Field"

Thanks in advance.
0
Comment
Question by:robin013197
1 Comment
 
LVL 5

Accepted Solution

by:
julio011597 earned 100 total points
ID: 1827720
What about just escaping the double quotes you need to add?
I.e.:

print MAIL "\"$INPUT{'category9'}\",\"$INPUT{'name'}\",...,\"Customer\"\n";

HTH
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now