Hi i am trying to split a csv file into single lines using the splittext processor but keep getting the ArrayIndexOutOfBoundsExeption error. I have the Line Split Count set to 1. Is there something i am doing wrong?. Thanks
Hi, @Matt Burgess. Thanks for the reply. I am fairly new to NiFi and not sure what to replace that character with.
I am using the trucking events data. The first two lines are as follows:
driverId,truckId,eventTime,eventType,longitude,latitude,eventKey,CorrelationId,driverName,routeId,routeName,eventDate 14,25,59:21.4,Normal,-94.58,37.03,14|25|9223370572464814373,3.66088E+18,Adis Cesir,160405074,Joplin to Kansas City Route 2,2016-05-27-22
I'm guessing this is a file with Windows-style line endings (\r\n). If that's the case you can search for \r\n and replace with \n, that should effectively switch the line endings to Unix-style endings and hopefully skirt the error you're seeing.
Hi, thanks for your time, i appreciate it. I tried to replace ('\r\n') with ('\n'). It does'nt give any errors, but nothing i passed from the replaceText to the splitText processor.
try just \r\n for Search Value, \n for Replacement Value, and Literal Replace as the Replacement Strategy. This type of line-ending conversion has definitely been done before, but at the moment I can't seem to find any examples.
Try putting just /r/n in the search and /n in the replacement. No parentheses or tick marks. Also try making the evaluation mode line by line. I think what you have is looking for '\r\n' with actual tick marks (single quotes) at the front and back, which you certainly don't have, so it will not change anything.
I am using Nifi 1.1.1 in Windows. I have a ANSI text file with flattened jsons on each line. When I pass this file via ListFile -> FetchFile -> SplitText, is fails with "ArrayIndexOutOfBoundsExeption". There are about 600+ jsons and total size of the file is about 180KB.
Now when I try the same file after removing few json lines, it goes thru and lines(jsons) are splitted for downstream processing. I also tried to move the jsons around to ensure it is not something in the data. I am pretty sure "\r\n" is not an issue. Several files have been processed in the same pipe.
So my question is there some limit on the file size which is causing this "ArrayIndexOutOfBoundsExeption"? How can we debug this situation?
Try using \r\n for the search text, without the parentheses or the quote marks. For the replacement text use \n, again without the other characters. Also, try line-by-line for the evaluation mode. I think that will let it match and remove the \r characters.