cancel
Showing results for 
Search instead for 
Did you mean: 

Java code for reading the Square symbol

Former Member
0 Kudos

Hi Experts,

My requirment is to read the EDI file through java ..... I am facing problem because in the EDI file the line is seperated by symbol 'square' .I cant read this symbol .... even i tried to copy the symbol but it is copied as blank space.....

how to handle it through java...

Regards,

RajeshKumar.D

Accepted Solutions (0)

Answers (2)

Answers (2)

p_2_5_6_9_6_0
Active Participant
0 Kudos

Hi,

The "square" symbol that you are referring to is probably a CRLF (Carriage Return - Life Feed) Control Character.

This is more commonly known as a "Enter" at the end of a line / sentence.

To clean this character from strings in Java, please use:

String patternStr = "(?m)$^|[\\r\\n]+\\z";
String replaceStr = " ";
Pattern pattern = Pattern.compile(patternStr);
Matcher matcher = pattern.matcher(inputStr);
return matcher.replaceAll(replaceStr);

Hope that helps.

Thanks.

p256960.

Former Member
0 Kudos

Hi,

Check the content type, it may help you to get some hints

Regards

Ayyapparaj