Solved

Form Return in "Comma-Delimited" Format

Posted on 1997-02-06
1
187 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 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

688 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