Formatter for Mail Forwarding
24 hours is equivalent to a day's time. and there is this email which I had received lately; after being forwarded a couple of times. meaningful it was, it should suffer the same fate once more, to be relayed to a bigger mass. but should I? well, nice stuffs are meant to be shared but it had been tormented by too many '>' characters; reading it proves to be difficult.
since it was hazy outside, my run was ruined. doing something helpful (but boring to many) might be the way to pass time. and there it was, the commencement of operation "symbolRemover" (it could have been named to someone i admire. 'operationCameronDiaz0' or 'missionJuliaRoberts5'? kind of strange? a proper name deemed more appropriate).
for convenience, java was used; eclipse was the IDE. as with most projects, technical difficulties were encountered. For example:
1) to use the split function (in the String class) for regex ".", one actually has to use the "//." character so that java can perform the correct recognition.
2) windows actually uses "/r/n" instead just "/n" to represent the newline character.. this caused difficulties in pattern recognition
3) care must be taken for the encoding of characters. For .txt files, characters are encoded in the form of bytes (8 bits for x86 machine on english windows); while for java, a char is represented by 16 bits (wide character). Usage of the wrong form (or encoding) can cause strange behaviours.
the eclipse project, .java, .class, .txt test and result (wordWrap required -> use view source) files can be downloaded at their respective links. its made open source. Hm.. under the GPL. Do feel free to use/distribute it. and if you like the program, still, no need to donate. :) To be frank, its not perfect, for the if-else statements lack intelligence, but still, it helps to eliminate most manual jobs.
well, do have fun and enjoy!
(note that setting of environmental parameters are necessary for the files to run in all directories... i will put the screenshots in my next blog entry in time to come. also do note that the file works fine on windows only because of the "\r\n" newline character. last but not least, to run the program, use the following command:
c:/blahBlahBlah/> java symbolRemover yourFileName.txt
A new file named "yourFileNameMod.txt" will be created in the same directory.)
and yup, that's it, enjoy and gd nite... else, tmr will be a bluey monday...
since it was hazy outside, my run was ruined. doing something helpful (but boring to many) might be the way to pass time. and there it was, the commencement of operation "symbolRemover" (it could have been named to someone i admire. 'operationCameronDiaz0' or 'missionJuliaRoberts5'? kind of strange? a proper name deemed more appropriate).
for convenience, java was used; eclipse was the IDE. as with most projects, technical difficulties were encountered. For example:
1) to use the split function (in the String class) for regex ".", one actually has to use the "//." character so that java can perform the correct recognition.
2) windows actually uses "/r/n" instead just "/n" to represent the newline character.. this caused difficulties in pattern recognition
3) care must be taken for the encoding of characters. For .txt files, characters are encoded in the form of bytes (8 bits for x86 machine on english windows); while for java, a char is represented by 16 bits (wide character). Usage of the wrong form (or encoding) can cause strange behaviours.
the eclipse project, .java, .class, .txt test and result (wordWrap required -> use view source) files can be downloaded at their respective links. its made open source. Hm.. under the GPL. Do feel free to use/distribute it. and if you like the program, still, no need to donate. :) To be frank, its not perfect, for the if-else statements lack intelligence, but still, it helps to eliminate most manual jobs.
well, do have fun and enjoy!
(note that setting of environmental parameters are necessary for the files to run in all directories... i will put the screenshots in my next blog entry in time to come. also do note that the file works fine on windows only because of the "\r\n" newline character. last but not least, to run the program, use the following command:
c:/blahBlahBlah/> java symbolRemover yourFileName.txt
A new file named "yourFileNameMod.txt" will be created in the same directory.)
and yup, that's it, enjoy and gd nite... else, tmr will be a bluey monday...





