> Thu, 28 Feb 2008 11:09:55 -0800 (PST), /tmw/:
>
[quoted text clipped - 22 lines]
> --
> Stanimir
I have tried some variations of this without success. I think this
'replaceregexp' should work with the correct parameters. Looking for
any ideas on correcting the paramters. Current example below
literally decides that there are at least 10 chars in the line and
then replaces the first 3 original chars with "lrn". (instead of
going every 10th char and replacing)
current task:
<target name="reformatData" depends="init">
<replaceregexp
byline="true"
match=".{10}"
replace="\l\r\n">
<fileset dir="${data_dir}"
includes="file.txt"/>
</replaceregexp>
</target>
ex: input.txt
some text in a file that rambles on and goes like this
output:
lnre text in a file that rambles on and goes like this
again - any ideas on the parameters goin in (match, replace)
thanks
Arved Sandstrom - 02 Mar 2008 15:37 GMT
[ SNIP ]
>> May be something like:
>>
[quoted text clipped - 10 lines]
> then replaces the first 3 original chars with "lrn". (instead of
> going every 10th char and replacing)
[ SNIP ]
I haven't used this task at all, but a quick review of the documentation
indicates that it uses some Perl5 type flags. For starters, it looks like
you'd want a flags="g" as an attribute. Also, if you literally want a
newline at every Nth position in the file, I suspect you do not want
"byline", but rather add the 's' flag also (which apparently treats the
entire file as a single string). It also appears that you'll need two
iterations, one to zap the existing newlines, one to put in the new ones.
AHS