I want to display the data from an EMAIL_TEXT database column splitting the columns at a defined character. For some reason my results are only printing the first line up to where I split the string skipping the rest of the lines. Here is the data I wish to split after every "|".
Here is a sample of the database column to be split.
TEXT TEXT Line1 |
TEXT TEXT Line2 |
The results printed are:
TEXT TEXT Line1
The desired results are :
TEXT TEXT Line1
TEXT TEXT Line2
Here is my Java Code:
String[] result = EMAIL_TEXT.split("\\|");
String subject="";
BufferedReader br;
BufferedReader brCSS;
FileReader fr;
FileReader frCSS;
String content="";
String CssContent="";
Document document1=null;
String FILEPATH = get(Fields.In, "FILEPATH").getString(r);
String filePathArray []=FILEPATH.split(",");
String mainContents = "";
int j;
try{
for(j=0;j<filePathArray.length;j++)
{
subject= get(Fields.In,"EMAIL_SUBJECT").getString(r);
fr=new FileReader(filePathArray[j]);
br= new BufferedReader(fr);
String s;
content = "";
String c;
if(mainContents.contains("header-image.jpeg")!=true)
{
mainContents += "<img src=header-image.jpeg>";
}
content = content + result[j];
while(( s=br.readLine())!=null)
{
content=content+s;
}
}
filePathArraythe same length asresult? You are using the same indexjin bothfilePathArray[j]andresult[j].for-loops then. One loop forresult, and one forfilePathArray. But it's hard to tell, when I don't know how you want to put together the text from the arrays and files.