0

I have a text file that was created in Unix environment. Now I want to process this file in java but on Windows environment. So is there are anyway I can get rid of problem of new line characters as Unix new line hexcode is '0A' but in windows it is '0D' and '0A' (carriage return and new line).

Note : I cannot recommend the file creator to change it. So I have to find the solution.

Shawn Chin
  • 84,080
  • 19
  • 162
  • 191
Ravi.Kumar
  • 761
  • 2
  • 12
  • 34

1 Answers1

0

There are many ways to convert the file to windows format. Convert it first, before you let the java program process it.

How to convert between Unix and Windows text files:

http://kb.iu.edu/data/acux.html

geby
  • 374
  • 2
  • 15
  • Then check this: http://stackoverflow.com/questions/3022407/how-to-identify-handle-text-file-newlines-in-java – geby Jul 13 '12 at 10:34