Link to home
Start Free TrialLog in
Avatar of guthrie
guthrie

asked on

How paste spreadsheet data into web page

I want a way to securely submit standard spreadsheet data (student grades).

One way would be if we could have a password protected web page, and have a form on it that a user could cut/paste into from their spreadsheet.

But, I am not familiar with a way to paste structured spreadsheet data into a HTML form.

The web page woud then iterate over the rows and make entries into a database.

The main context is that grades originate in a spreadsheet, and we want them to end up in a central database, and have some authentication over submission.
Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

Hi guthrie,

You would be better off allowing users to securely upload the spreadsheet and processing it from there.  Cutting and pasting won't work that well.
Avatar of sypder
sypder

You can upload a tab delimited file and process this with PHP and then put it into a MySQL database. This is explained at https://www.experts-exchange.com/questions/21821898/PHP-MySQL-INSERT-tab-delimited-file.html

Does that server your needs?
Avatar of guthrie

ASKER

Thanks for the replies.

Jason;
Thanks, that is what I figured about C&P, but was not sure. I already have a secure upload site, and can then use that. The issue is that it then takes more manual processing on the server side, to take the SS and process iinto database. I suppose that the upload servlet could also initiate (or do) the SS reading and database update, but the Java for that decoding is more complez & I was hoping to avoid it. (use Java POI I suppose...)

Syper;
to do that I would have to have the user take multiple steps, save as Tab-seperated, then read that and upload. But then the servlet could process it. In fact, could C&P the Tabbed data into a text field, and then read/process that - but overall it exposes more messyness to teh [naive] user.
(I was assuming servlets, but PHP could be used - we're mostly Java based!).

Thanks to both.
Guthrie,

Sorry to burst your bubble there.  The easiest thing of all would be to train the users to enter their grades via the site and allow them export a spreadsheet on demand.  That frees you up from having to worry about server side processing of CSV or TSV or Excel or whatever and still allows your users to export to a spreadsheet for their own calculations or what not.
Avatar of guthrie

ASKER

yes, I see your idea, but generally each person has their own private spreadsheets, some multipls sheets, which calculate grades in many and varied ways, the only commonality is that they all end up with a single set of columns on IDs and grades.

The grades are teh outcome of many updates and partial calsulations throught a course, and this is all local on a user machine. They only need (want) to connect to a simpler (restricrted) model for final reporting..

I'll bet that an AJAX page chould do it nicely, but I'm not yet proficient there..
If you're committed to using a regular ol' HTML form, then I agree that file uploading is the way to go.  The files can be processed post-upload to accomplish the same end result as just uploading the pertinent data would, it just involves a greater requirement for server-side processing, and will result in slightly more bandwidth usage.

On the other hand, if you're willing to go the ASP route, you could include a control on the webpage that could gracefully handle the spreadsheet data.  Also, there are libraries for using COM objects with Java, so you could likely create an applet that accepts OLE data that represents the spreadsheet data and handle it that way.  Doing so would, of course, make your website no longer platform-independent, but I got the impression most of your users are likely to be Windows users anyway, so... Maybe that's a solution that would work for you.
Avatar of guthrie

ASKER

Thanks.

No, I am not HTML restricted, in act presume a JSP page - but the user will have that as the interface.

I'm purely Java centric, so am not sure that I got all of your comments... but woudl presume that I could do the same thing wiht JSP. I guess what I would be missing is an active control to handel the spreadsheet data, but as you note could make an applet to do that; is this the basic idea?

So it would be .. an applet which makes a form, which accepts a paste of SS structured data? I'm not sur what this woudl involve... [No, I can't assume all windows users... :-( ]
ASKER CERTIFIED SOLUTION
Avatar of smidgie82
smidgie82
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Smidgie82,

If the spreadsheet is pretty simple, you will get a simple tsv paste.  The problems start to occur with cell-spanning and other formatting issues
Avatar of guthrie

ASKER

Smidgie82, thanks for the detailed explaination,a nd example. I think that if the TSV works, that will be fine, I'll cook up a simpel JPS page to test it.

Otherwise, possibilities abound...
Encrypted Email with attachment, SSH encrypted ftp of .xls, etc...

All inovolve various issues, but might be options.

Thanks.
Gregory