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

Urgent:Copy data from notepad/excel..simple though

P: n/a
cv
Hi all,

I have to copy two set of data from 2 files(notepad/excel) say,
products and their corresponding prices to list/textarea/table. I
should be able to retrieve the product and corresponding price
information from the control(list/textarea/table). Which is the best
way? Quite urgent.. pls let me know.

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


P: n/a
cv wrote:
Hi all,

I have to copy two set of data from 2 files(notepad/excel) say,
products and their corresponding prices to list/textarea/table. I
should be able to retrieve the product and corresponding price
information from the control(list/textarea/table). Which is the best
way? Quite urgent.. pls let me know.

TIA, cv


Open the file in Notepad, select the text you want to copy, select Edit
-> Copy.

Go into your favorite web page editor, select Edit -> Paste. Edit as
required.

Alternatively you could use File -> Save as HTML in Microsoft Excel,
then copy and paste the table it creates into your web page editor and
modify it as necessary.
The point is, what you want can't be accomplished by client-side
JavaScript in the default security environment, and although it's
possible to automate it using either VBScript in Microsoft Excel, or by
using the Windows Script Host, you'll probably need assistance
completing the task.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #2

P: n/a
cv
Grant Wagner <gw*****@agricoreunited.com> wrote in message news:<3F***************@agricoreunited.com>...
cv wrote:
Hi all,

I have to copy two set of data from 2 files(notepad/excel) say,
products and their corresponding prices to list/textarea/table. I
should be able to retrieve the product and corresponding price
information from the control(list/textarea/table). Which is the best
way? Quite urgent.. pls let me know.

TIA, cv


Open the file in Notepad, select the text you want to copy, select Edit
-> Copy.

Go into your favorite web page editor, select Edit -> Paste. Edit as
required.

Alternatively you could use File -> Save as HTML in Microsoft Excel,
then copy and paste the table it creates into your web page editor and
modify it as necessary.
The point is, what you want can't be accomplished by client-side
JavaScript in the default security environment, and although it's
possible to automate it using either VBScript in Microsoft Excel, or by
using the Windows Script Host, you'll probably need assistance
completing the task.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html


hi again,
do you mean to say it is not possible at all to copy/paste a set of
data like

123 $
456
789 @

like this to a html textbox/html list/html textarea and to get the
values in the next page after i submit the page??
thanx for any input, cv
Jul 20 '05 #3

P: n/a
cv wrote:
Grant Wagner <gw*****@agricoreunited.com> wrote in message news:<3F***************@agricoreunited.com>...
cv wrote:
Hi all,

I have to copy two set of data from 2 files(notepad/excel) say,
products and their corresponding prices to list/textarea/table. I
should be able to retrieve the product and corresponding price
information from the control(list/textarea/table). Which is the best
way? Quite urgent.. pls let me know.

TIA, cv


Open the file in Notepad, select the text you want to copy, select Edit
-> Copy.

Go into your favorite web page editor, select Edit -> Paste. Edit as
required.

Alternatively you could use File -> Save as HTML in Microsoft Excel,
then copy and paste the table it creates into your web page editor and
modify it as necessary.
The point is, what you want can't be accomplished by client-side
JavaScript in the default security environment, and although it's
possible to automate it using either VBScript in Microsoft Excel, or by
using the Windows Script Host, you'll probably need assistance
completing the task.


hi again,
do you mean to say it is not possible at all to copy/paste a set of
data like

123 $
456
789 @

like this to a html textbox/html list/html textarea and to get the
values in the next page after i submit the page??
thanx for any input, cv


Client-side JavaScript is unable to perform the copy/paste, which is what I thought you wanted. If you want
to move data from one page to another, you can put whatever data you want in whatever form elements you want,
then use:

<form action="nextPage.htm" method="GET">

On nextPage.html, you'd have:

var sSearch = window.location.search.substring(1);
var Parameters = new Object();
var sNameValuePairs = sSearch.split('&');
var sNameValuePair;
for (var i = 0; i < sNameValuePairs.length; i++) {
sNameValuePair = sNameValuePairs[i].split('=');
Parameters[sNameValuePair[0]] = sNameValuePair[1];
}
// now each item passed on the URL is in
// Parameters[itemName]
// so the value of your parameter can be accessed via
// Parameters["lastName"]

Of course, all the data you pasted would be in a single input (Parameters["whatYouPasted"]). You'll have to
parse it using .split(), then you could document.write() it as an HTML table.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
* http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
* http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.