[Dclug] high ascii

James Ewing Cottrell 3rd JECottrell3 at comcast.net
Wed Jun 17 21:35:48 EDT 2009


Or just edit the file with emacs. I dunno the RE for meta characters 
right off the bat, but I'm sure they can easily be constructed. 
Actually, looking for any non-printable char should do:

^S [ ^ SPACE - ~ ^Q ^I ^Q ^J ] ENTER

should work. Note that I put a space between each keystroke so you can 
read it. Perhaps the following would also work

^S [ ^Q 2 0 0 - ^Q 3 7 7 ] ENTER

JIM

Joseph S D Yao wrote:
> On Wed, Jun 17, 2009 at 10:54:14AM -0400, Timothy Ball wrote:
>> i have a huge PITA json file that i need to load into mysql but
>> somewhere in the file are two high ascii chars. i've already tried
>> several iterations of python that didn't work most of them were
>> something like: 
>>
>> for ch in data:
>>     if ord(ch) > 127:
>> 	print "whee!!! %s" % (ch)
>>
>> and it didn't work. oh dear this is driving me mad. does anyone have the
>> magic-fu to make this problem go away? 
> ...
> 
> 
> If this is a Microsoft file, then 'dos2unix' may work.
> 
> If you just wish to delete those characters, then:
> 	tr -d '[\200-\377]' < source > sink
> 
> If you wish to find them, I have always done an
> 	od -c < source > source.dump
> and then used 'vi' to home in on the regular expression " [23][0-7]".
> [note the initial space]
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 8.5.374 / Virus Database: 270.12.77/2184 - Release Date: 06/17/09 17:55:00
> 




More information about the Dclug mailing list