Code Comments
Programming Forum and web based access to our favorite programming groups.I've been given the job of writing a CGI script to receive the data from a = form and append it to a text file. Later, the text file will be analyzed = using MS Access. My problem is escaping characters which are often used as = delimiters in text-based importing formats, such as ' or " or \t or \n. = Any of these could be legitimately entered by a user into the text fields = of the form. I'd like to capture these, and not just discard them, and in = such as way that they can be easily converted back into the original = characters after importing into Access. Is there a standardized or commonly accepted way of doing this? I first looked at HTML::Entities, but it doesn't look as if it converts \t = or \n. Otherwise, this would be a good choice. I also looked at Unicode::St= rings, but it seemed as if this would convert the entire string to = Unicode, which I don't know if Access accepts, or if this would even = solve my problem. The form is an Adobe .pdf form with editable fields, which returns the = data as an .fdf file. Don't think this is important, but you can learn = more about it at http://www.adobe.com/support/techdocs/27f9a.htm. I tried searching CPAN on 'encoding' but that didn't seem to be the right = term. Thanks for your help and advice. -Kevin ----- E. Kevin Zembower Internet Systems Group manager Johns Hopkins University Bloomberg School of Public Health Center for Communications Programs 111 Market Place, Suite 310 Baltimore, MD 21202 410-659-6139
Post Follow-up to this message> I've been given the job of writing a CGI script to receive the data from a form and append it to a text file. Later, the text file will be analyzed using MS Access. My problem is escaping characters which are often used as delimiters in text-based importing formats, such as ' or " or \t or \n. Any of these could be legitimately entered by a user into the text fields of the form. I'd like to capture these, and not just discard them, and in such as way that they can be easily converted back into the original characters after importing into Access. > > Is there a standardized or commonly accepted way of doing this? > > I first looked at HTML::Entities, but it doesn't look as if it converts \t or \n. Otherwise, this would be a good choice. I also looked at Unicode::Strings, but it seemed as if this would convert the entire string to Unicode, which I don't know if Access accepts, or if this would even solve my problem. > > The form is an Adobe .pdf form with editable fields, which returns the data as an .fdf file. Don't think this is important, but you can learn more about it at http://www.adobe.com/support/techdocs/27f9a.htm. > > I tried searching CPAN on 'encoding' but that didn't seem to be the right term. > > Thanks for your help and advice. > > -Kevin > If possible you should consider using a CSV formatting module, this will translate best into Access (which you should avoid completely if possible). Text::CSV or even DBI/D::CSV are excellent. These modules will allow you to setup your delimiters however you wish, and Access should support importing from them. helps? http://danconia.org
Post Follow-up to this message>>> Wiggins d Anconia <wiggins@danconia.org> 09/29/04 12:08PM >>> If possible you should consider using a CSV formatting module, this will translate best into Access (which you should avoid completely if possible). Text::CSV or even DBI/D::CSV are excellent. These modules will allow you to setup your delimiters however you wish, and Access should support importing from them. helps? http://danconia.org =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= 3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D Helps very much. Thank you, Wiggins. -Kevin
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.