• Post Reply Bookmark Topic Watch Topic
  • New Topic

Insert \n in a cell of a .xls file

 
Nicolas Beaudet
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,
I've got a big problem. I have to insert a \n in a cell of an Excel file through JAVA programming. I've found that the Unicode character I'm searching is '\u000a' but the JAVA compiler does not accept this value. Does anyone have another idea??
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All character values are Unicode in Java. By specifying a literal newline you are telling the compiler that you want a newline in the middle of a character literal and that can't be done. Just use the '\n' literal. Same thing goes for '\r' and \u000D.
 
Nicolas Beaudet
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I simply use '\n', I don't stay inside the cell. The litteral '\n' inserts the Unicode '\u0d0a' in my file. The Unicode I want to insert is '\u000a'. Is there a similar litteral for this character??
Thanks.
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using POI by any chance? It seems to be a common problem. Maybe check with the mailing list
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!