Knowledge folder
 

EditFiles

by Veikko Niemi

Have you ever needed an editing program, which can edit beginstring...endingstring strings and everything between that?

Beginstring...endstring could either be replaced by another string or deleted or added so that nothing is deleted.

Ok, here it is my first JAVA program which I needed when I learned CSS styles. Because when using CSS styles in a html file you dont need special <font ... > sentences. I found that I had used various font specifications between <font ... > so I couldn't delete any more useless font-sentences by usual editprograms.

So I coded my first JAVA program named "EditFiles". Now its easy to navigate to /html catalog and by running my program two times per catalog I can first delete all <font...> sentences and second time all </font> sentences. I found that sometimes font sentences continue to second line so I included this feature in my program. Also I made possible to add either in the beginning string or ending string some text deleting nothing only adding some text..

I include my first program source here, but don't look at it, it's awful mess, but I tested the program carefully and hope that there doesn't exist any more bugs. Send me info with options you selected and input file if you meet problems. I can't take any responsibility to any claims concerning my program usage.

First time it's better to run with "simulate" checkbox selected, then the program doesn't write any file, otherwise the inputfiles are replaced by new edited contents.

That's my program here:

Starting window

When you click "START" you will get next window:

Navigate

And then you can select one or more files. You can view only files which you have filttered in the main window. If you have chosen htm/html/php you can see only that kind of file like here:

Open window

Then the program edit one file at a time showing counts if you have not chosen "No verify" option. If you run the program from source file f.ex. Netbeans IDE you can better see edit rows in IDE┬┤ console window.

Here is the result page:

Sum It

If you have chosen "No verify" you can see only one result window/folder and after pushing "FINISH" the final result window..

The program can skip over 3 different kind of text chains: scritp, php or user defined "START SKIP 1" ,..., " END SKIP 1 " chain portions.

You can run the program directly by double-clicking EditFiles.jar file, if you have JAVA runtime package on your PC, as nearly all have. You can get it quickly from here: http://www.java.com/en/download/, if you need it. You doesn┬┤ have to know if you have JRE-package, just try to run the program by double-cklicking EditFiles.jar program.

You must know that I can't take the liability of possible damages that this piece of software possibly causes to you or anyone using it, although I have made this software in as good purpose and knowledge as possible. Download: EditFiles_2008-08-06. Unzip the package and double-cklick the .jar program to execute it. Only Windows!

www.veikkoniemi.comto the beginning