By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,632 Members | 1,499 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,632 IT Pros & Developers. It's quick & easy.

How to Import a Flat Text File Into an HTML Table?

P: n/a
I have an HTML form with a pre-built table containing "standard"
column headings (for example, First Name, Last Name, SSN, Hours,
etc.). I want a user to be able to enter values into the form and then
submit it. The data will be emailed to an administrator who will then
print the month's report. I also plan to extract the data and store it
in an external flat text file so that there is an electronic backup
version.

The user would complete this form monthly, but may have reason to view
a prior month's form. So I'd like to offer an Import button on the
form that, when clicked, would retrieve the flat text file data and
display it in the pre-built table (obviously I'd have to provide some
mechanism for the user to identify which month's file they want to
view as well). Anyone aware of examples of this or have any ideas on
how to implement this?

Seems like there would have to be a way to extract the data from the
form, then write it to a file (using tab or pipe delimiters to
separate the columns), as well as a way to search for a particular
month's file, then read that file and display the data in the HTML
form (with the first name data in the First Name column, the last name
data in the Last Name column, etc.). Sounds do-able, but I'm not sure
how.

TIA,
Yellowbird
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
ye*************@hotmail.com (Yellowbird) wrote in
news:63**************************@posting.google.c om:
I have an HTML form with a pre-built table containing "standard"
column headings (for example, First Name, Last Name, SSN, Hours,
etc.). I want a user to be able to enter values into the form and then
submit it. The data will be emailed to an administrator who will then
print the month's report.

<snip>
Learn a scripting language like PHP, Perl, JSP, VBScript or some other.
With any of these you will be able to implement what you describe above.

--
News Updater, No scripts, No Database
http://www.xmlssoftware.com/NUpdater
Jul 20 '05 #2

P: n/a
ye*************@hotmail.com (Yellowbird) writes:
[snip] print the month's report. I also plan to extract the data and
store it in an external flat text file so that there is an
electronic backup version.


stop yourself right here and consider tieing a relational database (a
very simple one maybe) to this application.

failing this, you need to learn script coding and cgi programming to
get the dynamism that you're describing.

HTH
--
-------------------------------------------------------------------------------
Jerry Sievers 305 854-3001 (home) Unix Administrator/Consultant
305 321-1144 (mobile http://www.JerrySievers.com/
Jul 20 '05 #3

P: n/a
A relational database may be overkill. A flat file or a hash might just
as well do the job.

I have a pair of perl scripts which might be useful to learn from. One
appends form data to a file, the other sends it as a mail. They are too
long to post here (129 and 298 lines respectively) But you can do the
same in nearly any scripting language and your host/ISP may already
offer this capability.

If you chose the mail option, you do have to make sure about who you are
sending mail to and/or who your are receiving it from or else you will
end up as an HTTP-spam gateway.

If you choose the file option, be sure to use file locking on the off
chance that more than one user will submit a form at the exact same time.

For both, validate and otherwise make safe your data.

-Lars

Jerry Sievers wrote:
ye*************@hotmail.com (Yellowbird) writes:
[snip] print the month's report. I also plan to extract the data and
store it in an external flat text file so that there is an
electronic backup version.

stop yourself right here and consider tieing a relational database (a
very simple one maybe) to this application.

failing this, you need to learn script coding and cgi programming to
get the dynamism that you're describing.

HTH

Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.