I am working on Solaris and facing a problem. I have a .DAT file which simply contains some data in particular format which includes £ symbol. The fomat looks like
The requirement is a java program will be reading the file and printing the same file as it is. But when my program is reading the file and printing everthing is perfectly printed except "£" symbol (read as pound). It is printing "?" instead.
Observations :
1. When I am doing "cat Myfile.DAT" every thing getting displayed perfectly including £ symbol.
2. When I am opening the same file in vi editor it is displaying ASCII value for £ symbol. (/243).
3. I tried to change the encoding from java level by setting the property (in the program Myprog.java) like this
It is reading the .DAT file properly and printing properly. But the bottleneck is , we can not execute the java program from command line as a matter of fact, I tried to set the property(file.encoding) in code level by writing this:
but this does not work. From java level I am checking, it is showing that property has been set but actually the program is not working if I do it from code level.
How to proceed? Any ideas? Hopefully this has to be handled in java level not in Unix level (not sure).
Just to read a dat file and print the file output using java.
Thanks in advance.
Regards,
Bhaskar
Last edited by vgersh99; 08-26-2009 at 12:37 PM..
Reason: added code tags
Are you sure the file format is in ISO-8859-1?
maybe you shell enviorement is in ISO-8859-1 but this no means you file is in this code charset.
Be sure in which characterset are writing your file....for this porpues you can use some application/command that asegure you that the file is writing in this charset, the comand "file" can give you the charset or for example if you work with eclipse you can changed the encoding when you go to save the file
Other way is to probe change the -Dfile.encoding parameter...
I'll probe with
-Dfile.encoding=UTF16
-Dfile.encoding=UTF8
I am looking for help in processing of those options: '-n' or '-p'
I understand what they do and how to use them.
But, I would like to use them with more than one file (and without any shell-loop; loading the 'perl' once.)
I did try it and -n works on 2 files.
Question is:
- is it possible to... (6 Replies)
Hi All,
I am trying to copy a test from database into a file, basically that is what our application do. We will process all values and store it in a Linux file. When i look the database I am seeing as below
spend (£000's)
but after processing and stored to a file , i am seeing as... (3 Replies)
Dear all,
I have encountered some problem here. I prompt the user for input and store it into a data file, eg. key in name and marks so the data file will look like this
andrew 80
ben 75
and the next input is carine 90. So the problem here is i want to print... (2 Replies)
How I can get the current make-file name in a make-file
So, if I run make with specified file:make -f target.mak
is it possible to have the 'target' inside of the that 'target.mak' from the file name? (2 Replies)
I want to remove the commented lines in a file identified by ' symbol at the start of each ine. A sample example will be like:
Input
-----
'IFerr_flag=0THEN
iferr_flag=0then
iferr_flag=0then
iferr_flag=0then
iferr_flag=0then
iferr_flag=0then
iferr_flag=0then
Output
-------... (3 Replies)
Hi Gurus,
I had a problem writing a pipe file.
Previously i used this code to generate a tab seperated file
ABCEF := ABCEF || 'to_char('|| abc_tab(col_num).col_name || ') chr(9) || ';
Now i want the o/p as pipe seperated file.I changed the line as below
ABCEF := ABCEF ||... (0 Replies)
I've got a file, where I want to grab two fields from it. The file isn't fixed format, so all I know is that the two fields are after a certain number of delimiters within the record.
File e.g. as follows:-
"1"^"HEADER"^
"5"^"12345678"^"Smith"^"Dave"^"Mr"^"Research &... (1 Reply)
Hi,
I am working with Solaris 5.9 and I am newbie in Socket programming and I stated working with socket programming and I copyed a simple client & server program from a website which I am attaching with this and when I am compiling these files.I am getting the error--
Please Help me to... (1 Reply)