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

C

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
 
G

Grant Wagner

cv said:
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 <[email protected]>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_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-developer/upgrade_2.html
 
C

cv

Grant Wagner said:
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 <[email protected]>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_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-developer/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
 
G

Grant Wagner

cv said:
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.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 <[email protected]>

* Client-side Javascript and Netscape 4 DOM Reference available at:
* http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html
* Internet Explorer DOM Reference available at:
* http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_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-developer/upgrade_2.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,044
Latest member
RonaldNen

Latest Threads

Top