You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Mansour Al Akeel <ma...@gmail.com> on 2012/11/20 19:19:11 UTC

Line feed on windows

Hello all,
We are indexing and storing files contents in lucene index. These
files contains line feed "\n" as end of line character. Lucene is
storing the content as is,
however when we read them, the "\n" is removed and we end up with text
that is concatenated when there's no space.

I can re-read the files from the filesystem to avoid this, but I like
to see if there is other alternatives.

Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Line feed on windows

Posted by Jack Krupansky <ja...@basetechnology.com>.
This doesn't sound like a Lucene issue. It's up to you to read a file and 
pass it as a string to Lucene. Maybe you're trying to read the file one line 
at a time, in which case it is up to you to supply line delimiters when 
combining the lines into a single string. Try reading the full file into a 
single string, line delimiters and all. Be careful about encoding though.

-- Jack Krupansky

-----Original Message----- 
From: Mansour Al Akeel
Sent: Tuesday, November 20, 2012 1:19 PM
To: java-user
Subject: Line feed on windows

Hello all,
We are indexing and storing files contents in lucene index. These
files contains line feed "\n" as end of line character. Lucene is
storing the content as is,
however when we read them, the "\n" is removed and we end up with text
that is concatenated when there's no space.

I can re-read the files from the filesystem to avoid this, but I like
to see if there is other alternatives.

Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org