Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone!
I'm looking for any way to pull excel data into a text template (.txt, .html, or any other) so I can copy it to the clipboard from there.

Example of the text template

Name: (to be pulled from excel)
Surname: (to be pulled from excel)
Address: (to be pulled from excel)

All the excel files contain data in the same cells. Example - "name" is always in B15. I need to compile the template from every excel file separately.

The way it should work would be - I specify the file using "browse" button and the info gets pulled into a template. The template is getting cleared after data is copied and another file to be specified.

Any help on this issue would be very much appreciated.
Posted

1 solution

Have a glance at following link -
Excel to HTML table conversion and code generation utility[^]

Above link provides you information about reading an excel file.

Once that is done, you can simply copy that data into clipboard using -
JavaScript
// Method to set data in clipboard
window.clipboardData.setData("KeyName","my data goes here");
// Method to get data from clipboard
var contents = window.clipboardData.getData("KeyName");


Hope this works for you.

Many thanks.
Niral Soni
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900