Solved

Form Return in "Comma-Delimited" Format

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Ready Made PHP Scripts 5 70
Python:compare IP with IP:blahblah and output the entire line?? 7 61
how to pick specific file from ftp 13 56
Command prompt output to variable? 9 45
Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

776 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