Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Converting special characters?
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


Report this thread to moderator Post Follow-up to this message
Old Post
Kevin Zembower
09-30-04 07:55 AM


Re: Converting special characters?
> 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

Report this thread to moderator Post Follow-up to this message
Old Post
Wiggins d Anconia
09-30-04 07:55 AM


Re: Converting special characters?
>>> 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


Report this thread to moderator Post Follow-up to this message
Old Post
Kevin Zembower
09-30-04 07:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:42 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.