File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes Please help me. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Please help me." Watch "Please help me." New topic
Author

Please help me.

sujatha mamidala
Greenhorn

Joined: Nov 20, 2000
Posts: 19
I need put some text into some jsp files on a unix o.s. How can i get this thing done in one command. Because it's taking lot of time to open all the files and to paste the text in them. This is really urgent for me please help me out here. I have like more than 100 of jsp files.
Thanks a lot,
Suja.
George Brown
Ranch Hand

Joined: Sep 26, 2000
Posts: 919
can you be more specific?
such as:
- where does the text need to go, is there a marker of some sort in the JSP files that you could identify?
- should the text be at the start of the JSP? the end of the JSP?
- what is the text?
- are the JSP files easy to find or scattered?
If there is some sort of uniformity in the task at hand it should be easily automated by using a script. But I think you'll need to offer more detail about what you need to do before anyone can offer a solution.
sujatha mamidala
Greenhorn

Joined: Nov 20, 2000
Posts: 19
Thanks a lot for the reply. It's a html comment actually. I need to add a comment in the html portion of a jsp file. I am putting that after the title tag.The jsp files can be found easily they are all in the same directory. Please let me know if you have any questions.
Thanks,
Suja.
[This message has been edited by sujatha mamidala (edited March 14, 2001).]
George Brown
Ranch Hand

Joined: Sep 26, 2000
Posts: 919
so to confirm, you want to put an html comment directly after the title tag in all cases, so for example:
< title>My Title Here< /title>< !-- your block of text, the bit you want to insert -->
... other html stuff and jsp tags here ...
is that correct?

[This message has been edited by George Brown (edited March 14, 2001).]
George Brown
Ranch Hand

Joined: Sep 26, 2000
Posts: 919
here's a quick 'n' dirty way to do that, in the form of a shell script using sed for the text substitution. It should work with most unix boxen. It assumes that you have write access to all of the jsp files.
sujatha mamidala
Greenhorn

Joined: Nov 20, 2000
Posts: 19
George your script worked superbly. I am so grateful to you. Thank you very much.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please help me.
 
Similar Threads
PDF creation
Pass radio button/ text box responses from one page to another
YUI Autocomplete with XML and JSP
Relative path
Restricting access to file types in file input tag