Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Form Return in "Comma-Delimited" Format

Posted on 1997-02-06
1
Medium Priority
?
190 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
julio011597 earned 200 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
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.
Suggested Courses

618 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