Create a Java service with the input as the fileName. I have not tested this on large files but hope it will not break your IS.
IDataCursor pipelineCursor = pipeline.getCursor();
String fileName = IDataUtil.getString( pipelineCursor, "fileName" );
pipelineCursor.destroy();
try {
InputStream is;
is = new BufferedInputStream(new FileInputStream(fileName));
byte[] c = new byte[1024];
int count = 0;
int readChars = 0;
while ((readChars = is.read(c)) != -1) {
for (int i = 0; i < readChars; ++i) {
if (c[i] == '\n')
++count;
}
}
is.close();
IDataUtil.put( pipelineCursor, "numberOfLines", count);
} catch (IOException e) {
e.printStackTrace();
IDataUtil.put( pipelineCursor, "numberOfLines", e);
}
pipelineCursor.destroy();
}
Cheers,
Akshith
#Flow-and-Java-services#webMethods#Integration-Server-and-ESB