Thanks Stan

I'm also posting this to the list...


Stan Devitt wrote:
If you use the groovy maven plugin,    then the following <source> …</source> 
code comes close to what you need.

def resultfile = new File( "result" );

if (  resultfile.exists() ) resultfile.delete();

new File( "src/main/dictionary").eachFileMatch( ~/.*\.lst/ ) { file ->

      file.readLines().sort().each() { resultfile << it.trim() + "\n"; }

}

Notes:

*       If I understood you correctly, your source files are of the form   
a.lst, b.lst, c.lst  and contain the obvious content. If so, then you can just 
process them  in order in memory and avoid sorting the whole collection.

*       Also, your sed scripts appear to be essentially trimming the resulting 
strings, but if additional processing is needed, you can use more elaborate  
java methods such as  replace, replaceAll, replaceFirst, matches, substring, 
etc. in place of trim().

*       The code can also be dropped more or less as is into an execute() 
method of a groovy based maven plugin.

Stan Devitt ● RIM - Research In Motion Ltd. 175 Columbia St., Waterloo, Ontario Canada, N2L 5Z5
Office: +1-519-888--7465 x75512
Mobile: +1-226-338-1747




---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential 
information, privileged material (including material protected by the 
solicitor-client or other applicable privileges), or constitute non-public 
information. Any use of this information by anyone other than the intended 
recipient is prohibited. If you have received this transmission in error, 
please immediately reply to the sender and delete this information from your 
system. Use, dissemination, distribution, or reproduction of this transmission 
by unintended recipients is not authorized and may be unlawful.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to