ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject AW: find/replace
Date Tue, 07 Dec 2004 15:13:20 GMT
> Is there any way in using Ant that we can extract/find/match "strings"
> in html/excel file with a list of strings (java file names). 

Excel is not a fine format to work with ... from the Java point of view.
See the notes on the Apache POI project.
It would be better to export the XLS to a simple text format like CSV. Then
you can work simply with regular expressions, iterating over lines and using

> I have a big html file and a big excel file. I alwaz need to dig eyes
> into the excel column first to copy the java file name and then search
> it in the html file.

Sounds like these steps:
1. extract the java file names from excel
2. iterate over that list
3. search in html file(s)
4. Do ... what?

1. Extract the java file names from excel
a) XLS -> CSV
   Simply "Save As", or write a macro doing that.
b) extract the names from text file
   Would try <loadfile> with <filterchain>, maybe with <linecontains>
   And the <tokenfilter> with <replaceregex> should select only the name.

2. Iterate
   Use AntContribs <for>.

3. Search
   It depends on what you want to do. For "just" editing the <replaceregexp>
optional task
   could be useful.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message