Solved

Form Return in "Comma-Delimited" Format

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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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 …

734 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