Sponsored Content
Top Forums Shell Programming and Scripting How to make a £ symbol printed from a file? Post 302347763 by bhaskar_m on Wednesday 26th of August 2009 10:50:51 AM
Old 08-26-2009
How to make a £ symbol printed from a file?

Hi,

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

Code:
001|£30VB | | |T+T250|£30 Value Bundle |1|1|1 |0 |0|0 | |0|1010906 |93731 |TREVORJ |CRBCE1P |1090713 |134739 |JAMESMAT |CRBCE1P |9 |1|PRE-REPORT | | |

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

Code:
javac Myfile.java
    java -Dfile.encoding="ISO-8859-1" Myfile

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:
Code:
System.getproperty("file.encoding" , "ISO-8859-1");

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
 

10 More Discussions You Might Find Interesting

1. Programming

Error: Undefined Symbol ..... First referenced in file......

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)
Discussion started by: smartgupta
1 Replies

2. Shell Programming and Scripting

Get string from file after nth symbol

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)
Discussion started by: daveaasmith
1 Replies

3. Shell Programming and Scripting

Problem while concating PIPE symbol with a file

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)
Discussion started by: pssandeep
0 Replies

4. Shell Programming and Scripting

Remove the comment symbol ' from a file.

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)
Discussion started by: joyan321
3 Replies

5. Programming

makeutility: how to get the make-file name inside of the make-file?

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)
Discussion started by: alex_5161
2 Replies

6. Solaris

/usr/lib/passwdutil.so.1: symbol __nsl_fgetspent_r: referenced symbol not found

deleteing post (0 Replies)
Discussion started by: dshakey
0 Replies

7. Shell Programming and Scripting

Print new item in file with symbol

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)
Discussion started by: branred
2 Replies

8. Shell Programming and Scripting

Removing Symbols From a File like the copyright symbol

Hi guys, I have a txt file full of funny symbols like the copyright symbol and other funny ones that get in the way when trying to use sed. For example, not sure if you can read this but I have a line that looks like this: 24(9):995Â*1001 DOI: 10.1007/s11606-009-1053-2 © When I'm using... (1 Reply)
Discussion started by: joshdg
1 Replies

9. UNIX for Advanced & Expert Users

Pound symbol is not displayed in Linux file

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)
Discussion started by: arunkumar_mca
3 Replies

10. Shell Programming and Scripting

Perl command line option '-n','-p' and multiple files: can it know a file name of a printed line?

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)
Discussion started by: alex_5161
6 Replies
MALSYM(1)						      Malaga quick reference							 MALSYM(1)

NAME
malsym - compile a Malaga symbol file SYNOPSIS
malsym symbol-file malsym extended-symbol-file -use symbol-file DESCRIPTION
Malaga is a development environment for natural-language grammars based on the Left-Associative Grammar formalism. Malaga grammars can be used for automatic morphological and/or syntactic analysis. The program malsym compiles a Malaga symbol file. Give it the symbol file (suffix .sym or .esym) that is to be translated as argument. If an extended-symbol-file (suffix .esym) is to be compiled, you must add the option -use. See info Malaga for details. OPTIONS
-h[elp] Print a help text about malsym's command line arguments and exit. -u[se] symbol-file Use the already compiled symbol-file as the base symbol file when compiling an extended symbol file. -v[ersion] Print malsym's version number and exit. AUTHORS
Malaga has been developed by Bjoern Beutel. Numerous other people distributed to it. This manpage was originally written for the Debian distribution by Antti-Juhani Kaijanaho. SEE ALSO
malaga(1), mallex(1), malmake(1), malrul(1), malshow(1) ``Malaga 7, User's and Programmer's Manual''. Available in Debian systems via info Malaga, and, if the malaga-doc package is installed, in various formats (DVI, Postscript, PDF, HTML) under /usr/share/doc/malaga-doc/. Malaga 26 September 2006 MALSYM(1)
All times are GMT -4. The time now is 03:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy