• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Insert \n in a cell of a .xls file

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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??
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic