[Swift-user] regexp problem
Antonius Sardjito
sardjito.antonius at gmail.com
Fri Jan 22 09:59:14 CST 2010
Hi Dr. Wilde,
I am able to readData from the input now, into an array of string. I am
currently trying to use the strcut and strcat to cut the ".tif" and replace
it with "Colored.tif"
I tried to do something like this:
string cutresult =
@strcut(output[0],"/home/wilde/bigdata/data/modis/output/");
#outfile = eccho(output[0]);
trace(output[0]);
and the error is :
*
RunID: 20100122-0951-345qqi15
Progress:
SwiftScript trace: /home/wilde/bigdata/data/modis/output/h11v05.tif
Execution failed:
java.lang.IndexOutOfBoundsException: No group 1
I don't understand why I got the error IndexOutOfBounds, I have checked the
string using a procedure that echo the string to a file, and as you can see
from above I also checked it with trace(output[0]) which produces a valid
value.
-Antonius
ps.
This is the whole test file named mini.swift
type file;
file input <"input_for_mini_test.txt">;
string output[] = readData(input);
file outfile <"output_for_mini_test.txt">;
string color = "Colored.tif";
app (file out) eccho (string inputStr)
{
echo inputStr stdout=@out;
}
outfile = eccho(output[0]);
string cutresult =
@strcut(output[0],"/home/wilde/bigdata/data/modis/output/");
trace(output[0]);
--EOF--
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-user/attachments/20100122/51fed506/attachment.html>
More information about the Swift-user
mailing list