Page 1 of 1
Null characters (code=0)
Posted: Wed Jun 06, 2012 1:51 pm
by lochrane
hello,
textpad 6 on a windows 7 is behaving differently from textpad installed on windows xp.
i have an .OBS survey files that has characters in the file that are null and we can see then in windows xp and can overwrite them. textpad on windows 7, we can't see the characters, so we don't know where to overwrite them and you also can't copy the characters and get the following error:
"cannon cut, copy, or drag and drop text containing null (code = 0) characters".
i'm fine with not being able to copy the character, I just want to be able to see the character to overwrite it.
i looked through all the preferences and can't find anywhere to turn view on for these type of characters. seems to be a bug with textpad on windows 7 64-bit computers.
thanks,
david
Posted: Wed Jun 06, 2012 7:02 pm
by kengrubb
You should be able to do a global replace. This will turn them into spaces.
Edit
Replace
Find what: \x00
Replace with: (a single space)
Check Regular Expression
Posted: Wed Jun 06, 2012 7:04 pm
by lochrane
i can't see the characters at all, so I'm not sure where to do a replace?
i need to be able to see the characters and it seems that I can't see them when the software is installed on a Windows 7 computer.
Posted: Wed Jun 06, 2012 7:11 pm
by kengrubb
That's a function of the font used, but you can certainly do a Find
\x00
With Regular Expression checked
Posted: Wed Jun 06, 2012 7:17 pm
by lochrane
i'm lost here. its an ascii character and doesn't show up and sometimes the characters are different depending on the file and the way that the OSB file was generator from our data collecting machines.
if I can't see it and can't copy it, how I am going to find and replace it?
Posted: Thu Jun 07, 2012 7:20 am
by ACRobin
Lochrane,
Kengrubb is right in that you can use "\x00" in the find dialogue to locate a Null, and it is probably the font you are using that cannot display the Null or any of the "unprintable" characters.
You say, how are you going to locate exactly what character to find and therefore replace, as a Null is not always the character you need to get rid of - well the best way to see all characters in the file is to open the document in "Hex" mode a Null is hex "00". The only problem with hex mode is that it is read only and you will then need to open the document normally to be able to do your find and replace.
Yes - ok, you will not be able to locate the Null (or what ever) to "Cut" it into the Find/replace dialoged, but you will know the Hex code for the character to be changed and therefore be able to do as Kengrub suggests.
Posted: Thu Jun 07, 2012 7:20 am
by kengrubb
Null is an ASCII character, but what is it's visual representation? How about the visual representation of a CR, LF or Tab? If you jump up to extended ASCII, same thing. Depends upon the font. Might be a blank space. Might be a block box.
Posted: Thu Jun 07, 2012 3:24 pm
by lochrane
i've opened in HEX mode and it looks like 00 is what i need to remove. i then opened the file in normal text mode and did a find for hex 00. it has 00 identified all over the place and if I do a replace-all with a space, it locks up textpad.
i checked the text font and it is set to courior new on both windows xp and windows 7 computer, providing different visual results from each other despite font type.
here is a screenshot of what it looks like in windows xp -
http://www.lochrane.com/downloads/xp.PNG
here is a link to the actual .OBS file that I am having problems with in seeing the block characters to remove from the file.
http://www.lochrane.com/downloads/94221DE.OBS
i'm lost at this point and need additional help.
thanks!
Posted: Thu Jun 07, 2012 6:19 pm
by kengrubb
How large is the file?
Also, how many occurences of Null are in the File? If you do a File In Files for \x00 in the file, you get back a count. Specify "File counts only" under "Report details".
If the file is a few hundred meg, and there are tens of thousands of occurences of Null, yeah it might eat resources.
You could try shutting down absolutely everything you don't need that is a potential resource hog. Email, word processor, etc.
Posted: Thu Jun 07, 2012 6:24 pm
by MudGuard
the file that lochrane posted is 204K in size, it contains 23 zero-characters, which can be replaced without problem by a space, the time taken is too short to measure (using TP 6).
Posted: Thu Jun 07, 2012 8:11 pm
by lochrane
ok. thanks for telling me that it can be done. I am interested in knowing how it can be done.
i don't have any other apps open, I have an i5 sandybridge quadcore CPU with 16GB of mem. i don't think it is a resource issue.
thanks!
Posted: Thu Jun 07, 2012 8:43 pm
by lochrane
ok got it. regular expression needed to be checked in the find and replace dialog box.
issue is resolved.
thanks!