display all possible control characters from .xml file in unix

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting display all possible control characters from .xml file in unix
# 1  
Old 12-08-2008
display all possible control characters from .xml file in unix

I have a .xml file in unix. We are passing this file through a xml parser.
But we are getting some control characters from input file and XML parser is failing for the control character in file.Now I am getting following error,

Error at byte 243206625 of file filename_$.xml:
Error reported by XML parser: invalid UTF-8 byte (check the XML declaration) (code: 0x96)
Transformation failed: Run-time errors were reported
ERROR: performing: java -Xmx512m -mx1024m -Xss1024m -Xoss1024m -jar /java/saxon/saxon.jar

I need to find out the control character for which XML parser is failing and giving above error. OR
Does any one knows a command in unix which will list all control characters from file in unix??
# 2  
Old 12-09-2008
0x96 is decimal 150. In US ASCII this is the accented character (u circumflex).

You can use "cat -v" to display unprintable characters. See "man cat" to understand the representation of 8-bit characters.

cat -v filename
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to strip control-A characters from a column in a file

Hi All, I currently have flat file with 32 columns. The field delimiter is cntl-A ( \x01). The file has been extracted from an oracle table using a datastage job. However, in the 6th field, the data contains additional control -A characters which came as a part of the table data. I need... (12 Replies)
Discussion started by: harsha1238
12 Replies

2. Red Hat

Special control characters in file

Hi Guys, We receive some huge files on to Linux server. Source system use FTP mechanism to transfer these files on our server. Occasionally one record is getting corrupted while transfer, some control characters are injecting into the file. How to fix this issue ? please advice ? Sample... (2 Replies)
Discussion started by: srikanth38
2 Replies

3. Shell Programming and Scripting

How to view the control characters in a file?

Hello, How can I view control and special characters of a text file?. For example, space, tabs, new line chars etc. Can I use hexdump for it? Thanks (3 Replies)
Discussion started by: reddyr
3 Replies

4. UNIX for Dummies Questions & Answers

Control characters in UNIX

Hi, My files are showing some control characters in vi editor ^M ^@ and somtimes ^H I removed ^M with %s/^M//g command but how to represent ^@ and ^H e.g. for ^M it is hold ctrl then v and m.. Please help.. I am very new to unix.. (7 Replies)
Discussion started by: prabhat.diwaker
7 Replies

5. Shell Programming and Scripting

Request for advise on how to remove control characters in a UNIX file extracted from top command

Hi, Please excuse for posting new thread on control characters, I am facing some difficulties in removing the control character from a file extracted from top command, i am able to see control characters using more command and in vi mode, through cat control characters are not visible ... (8 Replies)
Discussion started by: karthikram
8 Replies

6. UNIX for Dummies Questions & Answers

XML file shows Junk Characters in UNIX

Hello sir, I have generated XML file from VS 2005. It works well in windows but it shows some junk characters in unix. Can any help me with this problem. Thank you in advance. Hema (6 Replies)
Discussion started by: hemavenkatesh
6 Replies

7. UNIX for Advanced & Expert Users

How to display the ascii characters in java using unix OS

The below code is not able to converting the Hexa decimal characters into Ascii characers in Unix. byte bytes = newbyte; for(int i=0;i<bytes.length;i++){ bytes = (byte)Integer.parseInt(hex.substring(2*i, 2*i+2),16); } String multi = new String(bytes); System.out.println(" multi value from... (0 Replies)
Discussion started by: srinivaspeyyala
0 Replies

8. Shell Programming and Scripting

Hidden control characters in a Unix Text File!

Can anyone seem to know how to find out whether a UNIX text file has 'hidden' control characters? Can I view them using 'vi' by some command line options? If there are control characters in a text file which are invisible/hidden.. then how do I get rid of them? Your intelletual answers are... (6 Replies)
Discussion started by: kewl_guy
6 Replies

9. UNIX for Dummies Questions & Answers

Unix file does not display special characters

We have a unix file that contains special characters (ie. , , , , , ). When I try to read this file I get a codepage error and the characters are replaced by the # symbol. How do I keep the special characters from being read? Thanks. Ryan (3 Replies)
Discussion started by: Ryan2786
3 Replies

10. Programming

Identifying and removing control characters in a file.

What is the best method to identify an remove control characters in a file. Would it be easier to do this in Unix or in C. (0 Replies)
Discussion started by: oracle8
0 Replies
Login or Register to Ask a Question

Featured Tech Videos