The FIRST thing the shell does is truncate "some.file" (i.e. set it's content to zero bytes); THEN it opens some.file as input to be read via the stdin of some_process. The result is: no data read by the process, because there's no longer any data in the file. Hope you have a backup copy...some_proeccess < some.file > some.file
For another, when you see something like \u0016, that's a hexadecimal value, You can "grep" for that using a perl one-line like the following:
Or, if the file is NOT UTF-16, you could just do:perl -CS -ne 'print if /\x{0016}/' < some.file
Of course, \u0016 isn't the only character that an XML library would reject, and if your file has a bunch of different ones, it gets tiresome fixing them one codepoint at a time as they get reported in error messages.perl -ne 'print if /\x16/' some.file
You can look up how valid vs. invalid XML characters are enumerated (many people use regexes - e.g. on stackoverflow), and run a diagnosis on your file(s) before feeding them to your script (or just add code to your script to filter out the bad characters, if you're sure that just deleting them is The Right Thing To Do).
In reply to Re: How to remove error: Code point \u0016 is not a valid character in XML
by graff
in thread [Solved]:How to remove error: Code point \u0016 is not a valid character in XML
by Perl300
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |