Hi,
I have a lot of JSP files that serve as pure JavaScript code. I need to
convert all JavaScript comments inside these JSP files to JSP comments
which use <%-- // --%> tags. Instead of doing it manually, I would
like to write a script/program that can detect the JS declarative
comment structure and replace it with the equivalent JSP comment.
However, I do not know how to start writing such kind of
script/program. I would appreciate alot if you can suggest me some
tool/program, Linux shell command or programming language (Perl,
JavaScript, ...) that I can use. Is there any available program out
there that is doing this task ?
Thanks in advance,
Tung Chau 4 2162 tu********@yahoo.com wrote: Hi, I have a lot of JSP files that serve as pure JavaScript code. I need to convert all JavaScript comments inside these JSP files to JSP comments which use <%-- // --%> tags. Instead of doing it manually, I would like to write a script/program that can detect the JS declarative comment structure and replace it with the equivalent JSP comment. However, I do not know how to start writing such kind of script/program. I would appreciate alot if you can suggest me some tool/program, Linux shell command or programming language (Perl, JavaScript, ...) that I can use. Is there any available program out there that is doing this task ?
Thanks in advance, Tung Chau
Hi Tung,
Well, what you are asking for is a straightforward search-replace alghoritm,
right?
Such tasks are easy with scriptinglanguages like PHP or Perl.
Even VB-script should be able to do it. ;-)
My Perl suck these days, so if you can go PHP, have a look at: http://nl2.php.net/manual/en/function.str-replace.php
and fopen() for opening.
try to make a program that opens all files, replaces your commentstags, and
then safes the file.
Regards,
Erwin Moller
<tu********@yahoo.com> wrote in message
news:11**********************@f6g2000cwb.googlegro ups.com... Hi, I have a lot of JSP files that serve as pure JavaScript code. I need to convert all JavaScript comments inside these JSP files to JSP comments which use <%-- // --%> tags. Instead of doing it manually, I would like to write a script/program that can detect the JS declarative comment structure and replace it with the equivalent JSP comment. However, I do not know how to start writing such kind of script/program. I would appreciate alot if you can suggest me some tool/program, Linux shell command or programming language (Perl, JavaScript, ...) that I can use. Is there any available program out there that is doing this task ?
Thanks in advance, Tung Chau
That wheel has already been invented.
You can google to find a shareware to search/replace through an entire
directory.
Its been several years since I used one, so the name of the one I used has
departed the memory banks.
But look at it as a find-replace task, heck, even MS Word can do that for a
file at a time.
HTH Hal tu********@yahoo.com wrote: Hi, I have a lot of JSP files that serve as pure JavaScript code. I need to convert all JavaScript comments inside these JSP files to JSP comments which use <%-- // --%> tags. Instead of doing it manually, I would like to write a script/program that can detect the JS declarative comment structure and replace it with the equivalent JSP comment. However, I do not know how to start writing such kind of script/program. I would appreciate alot if you can suggest me some tool/program, Linux shell command or programming language (Perl, JavaScript, ...) that I can use. Is there any available program out there that is doing this task ?
man find
man sed
--
Ian Collins.
JRS: In article <OA*******************@bignews3.bellsouth.net>, dated
Fri, 2 Jun 2006 15:46:56 remote, seen in news:comp.lang.javascript, Hal
Rosser <hr*****@gmail.com> posted : That wheel has already been invented. You can google to find a shareware to search/replace through an entire directory.
Why go to that expense? See in sig.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
I find MiniTrue useful for viewing/searching/altering files, at a DOS prompt;
free, DOS/Win/UNIX, <URL:http://www.idiotsdelight.net/minitrue/> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mike |
last post by:
I am sure that I am making a simple boneheaded mistake and I would
appreciate your help in spotting in. I have just installed
apache_2.0.53-win32-x86-no_ssl.exe
php-5.0.3-Win32.zip...
|
by: James Hu |
last post by:
This program is long. I don't really want to bore everyone with the
details, but it handles wierd cases like:
/\
* this is a comment *\
/
#define FOO ??/* this is not a comment */
char...
|
by: Hardy Wang |
last post by:
Hi:
I have a XML like
<?xml version="1.0" ?>
<object>
<comments>www.site.com/page.aspx?param1=value1¶m2=value2</comments>
</object>
Since "&" is invalid in XML, I need to replace all "&"...
|
by: KenFehling |
last post by:
Hello. I am wondering if there exists a piece of software that takes
multiple .js files that are nicely indented and commented and create
one big tightly packed .js file. I'm hoping the one file...
|
by: Mike Polinske |
last post by:
I am new to the C programming language but have been programming in
Cobol for over 10 years. When I compile the following code, it
compiles clean but I get an application error both under Windows...
|
by: Francine.Neary |
last post by:
I am learning C, having fun with strings & pointers at the moment!
The following program is my solution to an exercise to take an input,
strip the first word, and output the rest. It works fine...
|
by: neptundancer |
last post by:
Hi,
to extend my skills, I am learning python. I have written small
program which computes math expression like "1+2*sin(y^10)/cos(x*y)"
and similar, so far only + - * / ^ sin con tan sqrt are...
|
by: lex __ |
last post by:
I'm tryin to use regexp to replace multi-line c-style comments (like /* this /n */ ) with /n (newlines).
I tried someting like re.sub('/\*(.*)/\*' , '/n' , file)
but it doesn't work for...
|
by: WP |
last post by:
Hello, below is my very first python program. I have some questions
regarding it and would like comments in general. I won't be able to get
my hands on a good python book until tomorrow at the...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |