File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Java Script for File Handling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Java Script for File Handling" Watch "Java Script for File Handling" New topic

Java Script for File Handling

Anurag Mishra
Ranch Hand

Joined: Jun 16, 2003
Posts: 121
I want to write a java script which will read a file from a directory then it will match a word <HTML> in a file and then it will append <TEST>
just before the <HTML>.
If anyone has done this type of java script or have some idea pls reply.
thanks in advance.

SCJP 1.2
Tom Blough
Ranch Hand

Joined: Jul 31, 2003
Posts: 263
JavaScript does not allow access to the underlying file system. I don't think you will be able to do what you want. If this is a program that will run on a local machine, you could use Java or any other programming language to accomplish this.

Tom Blough<br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr>Cum catapultae proscriptae erunt tum soli proscripti catapultas habebunt.<hr></blockquote>
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63873

If this operation is to be performed on the server, a servlet is probably your best bet. If this is a client-side operation you are out of luck as no client-side file access can be performed (think of the security implications otherwise) except via a signed applet.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Java Script for File Handling
It's not a secret anymore!