Getting tab-delimited data from html form

They have: 9 posts

Joined: Nov 2003

Hi, I'm using Matt's FormMail Perl script to get user registration information from an HTML form on my site. I'm trying to have it delivered to Outlook in tab-delimited format so I can paste it into an excel worksheet (or maybe a database later on). The problem is that the tabs are not present when I receive the email in Outlook from the script. I suspect there is a difference in the way tabs are handled between Unix/Linux and Windows. The server is Linux-based and my computer is WinXP.

As an experiment, I had the form results go to my Yahoo account (Yahoo's mail server is FreeBSD). When I check the mail there, I can copy it and paste it into excel and the data is tab-delimited and so it went into separate cells in Excel. When I get the mail delivered to Outlook, however, the data has no tabs. When I copy it from Outlook and paste into Excel, all the data is pasted into one (long) cell.

Here is part of the code from my script, where I output the user's first and last name, and a tab after each element:
print MAIL "$Config{'first_name'}\t ";
print MAIL "$Config{'last_name'}\t ";

What do I need to do to get those tabs to show up when I'm viewing the output on a Windows computer? Thanks for any help!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

What do you mean the tabs aren't present? The tab symbols or the tabs themselves? They are hidden characters in Outlook.

It may be better to save the information to a file, then store that file on your server?

They have: 9 posts

Joined: Nov 2003

I mean the tabs themselves aren't present--I know they are invisible.

When I get the output mailed to my Yahoo account (Unix-based system), I can copy it and paste it into Excel and each data field gets put in a separate cell. The output viewed through Yahoo shows each data field separated by a tab-sized space.

When I get the output mailed to my ISP's mail server and copy it from Outlook, it gets put into one cell in Excel, instead of separate cells. Thus, I concluded that the tabs are not there. Plus, it's obvious just looking at the data that the tabs aren't present because each data field is only separated by a single space, not the larger space of a tab.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Try viewing the source of the email instead of viewing it in Outlook? It may render differently.

I've found that some systems send me the content embedded in the message when files are attached, which can cause me some degree of annoyance unless I look at the raw message source.

Saving it to a file will give you more consistent results.

He has: 1,758 posts

Joined: Jul 2002

And of course... if you NEED it to be emailed, just attach the file to the email. It's one extra step to get it into excel but nothing major...

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.