Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please help me.

 
sujatha mamidala
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 919
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 919
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 919
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
George your script worked superbly. I am so grateful to you. Thank you very much.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic