Author Topic: How can I see binary characters in a text file?  (Read 7064 times)

dfechser

  • Senior Community Member
  • Posts: 123
  • Hero Points: 0
How can I see binary characters in a text file?
« on: July 23, 2014, 04:03:27 PM »
I am using Slickedit for the PC but am working on files on a Linux server.

"diff" in Linux tells me that there binary characters in my file but I cannot find them. Is there some way to get Slickedit to highlight or otherwise display binary characters so that I can find them?

davehohl

  • Senior Community Member
  • Posts: 271
  • Hero Points: 27
Re: How can I see binary characters in a text file?
« Reply #1 on: July 23, 2014, 04:48:05 PM »
Have you played with the options in the View menu? You can display a text file as hex values, as well as view various types of non-printable characters.

dfechser

  • Senior Community Member
  • Posts: 123
  • Hero Points: 0
Re: How can I see binary characters in a text file?
« Reply #2 on: July 23, 2014, 04:54:29 PM »
That gets me closer.
I Used View->Special Chars and then saw all the CRs. I then turned off CR, TAB, and spaces. I assume there is binary character somewhere in the file but it doesn't stand out.

Is there some way to search for "all special chars" or to change color coding on special chars so that these would become obvious to me?

Thanks,

Dave F.

davehohl

  • Senior Community Member
  • Posts: 271
  • Hero Points: 27
Re: How can I see binary characters in a text file?
« Reply #3 on: July 23, 2014, 04:58:03 PM »
If you use Tools/Options... to open the Options dialog box, you can type "color" into the search field and then look at Appearance/Colors. Under the General options there is a selection for Special Characters.

dfechser

  • Senior Community Member
  • Posts: 123
  • Hero Points: 0
Re: How can I see binary characters in a text file?
« Reply #4 on: July 23, 2014, 05:05:35 PM »
Okay. I changed the special chars coloring to be real obnoxious so the CRs show up really bright. I still cannot find whatever diff is talking about, however.

diff still gives me results so I guess I won't worry about it at this time.

Thanks for your help.

Dave F.

jimlangrunner

  • Senior Community Member
  • Posts: 360
  • Hero Points: 31
  • Jim Lang - always a student.
Re: How can I see binary characters in a text file?
« Reply #5 on: July 23, 2014, 05:59:08 PM »
Off the top of my head....

if you're comparing Linux file to PC file, you'll find CR/LF on PC and just LF on the linux files. That would give you a binary difference that wouldn't show as a textual difference.

Somewhere there's a command to look at file format (PC or Linux). I'm not sure where it is, though.

If you're looking for non-text differences, when you invoke the VS diff tool, choose the option for NOT using source diff.  Source Diff ignores whitespace (and will tell you things like tabs and spaces are equivalent).  NOT source diff will highlight every difference. 

HTH.

dfechser

  • Senior Community Member
  • Posts: 123
  • Hero Points: 0
Re: How can I see binary characters in a text file?
« Reply #6 on: July 23, 2014, 06:29:52 PM »
I used the Linux "diff" command from within the Linux system.

It does the diff but gives me a warning that says there are binary characters in the file.

The diff was done on the Linux command line, outside of Slickedit.

I just cannot find a way inside or outside of Slickedit to find the binary character.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: How can I see binary characters in a text file?
« Reply #7 on: July 23, 2014, 06:38:25 PM »
You could try a regular expression search: [\x00-\x1f].  That one will pick Tab characters, if you want to ignore those you could use [\x00-\x08\x0a-\x1f].  That is if it is referring to control characters as binary characters.
« Last Edit: July 23, 2014, 06:43:17 PM by Lee »

dfechser

  • Senior Community Member
  • Posts: 123
  • Hero Points: 0
Re: How can I see binary characters in a text file?
« Reply #8 on: July 23, 2014, 06:50:28 PM »
That was a very good suggestsion but it didn't find the character.
I experimented and found that I can use [\x00-\x1f\x92-\xff] and it finds only the apostrophes. If I eliminate the apostrophe (92->93) then it finds nothing.

diff still says that binary chars exist in the file but maybe there is some sort of meta data that is causing it to think so.

Dave F.

Phil Barila

  • Senior Community Member
  • Posts: 745
  • Hero Points: 61
Re: How can I see binary characters in a text file?
« Reply #9 on: July 23, 2014, 07:33:38 PM »
Do the diff in the slickedit diff with source compare off, like jimlangrunner said.  It should show you the problem char(s).

dfechser

  • Senior Community Member
  • Posts: 123
  • Hero Points: 0
Re: How can I see binary characters in a text file?
« Reply #10 on: July 23, 2014, 08:00:19 PM »
I found it!

Thanks for your help!

Dave F.