Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Square character in text files

Posted on 2005-04-05
6
Medium Priority
?
2,476 Views
Last Modified: 2010-08-05
I'm asking this question in the perl area because I'm writing a perl script and I want to delete this square character from a bunch of files before I combine them. So, onto the question....

In text files, I occasionally encounter a square character. It appears as if it is just a space, but one can search for it specifically (after copying it) and get rid of it. What is this character? I've done some searches and have come up with nothing. Thanks.
0
Comment
Question by:Feyo
6 Comments
 
LVL 5

Expert Comment

by:steve_bagnall
ID: 13706359
Hi Feyo,

I think your text editor will show you that square character if it encounters any non-standard ascii character that it does not know how to display.  If you open your file in a hex editor, you will be able to see what it really is, try Hex Workshop http://www.bpsoft.com/ or something similar.

Cheers,
Steve
0
 
LVL 16

Expert Comment

by:manav_mathur
ID: 13706815
Did you transfer this file from Unix to Windows or vice-versa??
0
 
LVL 4

Author Comment

by:Feyo
ID: 13707092
The original data comes from scanforms and it goes directly into Windows.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Assisted Solution

by:Talmash
Talmash earned 200 total points
ID: 13707414
this line may help you find what is the ascii for any char:

perl -ne '@l=split(//,$_);for $x (@l){print "$x is ".ord($x)."\n";}'
tal
0
 

Accepted Solution

by:
jphofmann earned 200 total points
ID: 13710604
As pointed out above, a 'square character' is displayed when the underlying ASCII character is unrecognized. It is worth noting that the 'square character' can represent many different unrecognized characters. More then likely you have a mixture of individual types of characters making up your square characters.

Often these characters have to do with the formatting of text, that when carried over from platform to platform are not displayed correctly.  That being said, you may with to not just delete these characters but replace them with an appropriate counterpart.

http://www.lookuptables.com provides a complete reference of ASCII codes and there character counterparts.  Using this you should be able to determine why they are in your text files.
0
 
LVL 4

Author Comment

by:Feyo
ID: 13740395
I appreciate the information. It pointed me in the correct direction. Thanks for the help.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question