Thanks for the solution. It works perfectly fine. There is one more issue though. I'm trying to identify the number of bytes, lines and max line length using below command.
But it ends up in error whenever it comes across any line having extended ascii characters in it and ends up with below error.
Any solution to ensure it doesn't fail? I dont want to remove the extd. ascii characters from the line. One way I could think is to create a temp file, replace the extd. ascii characters with a normal one (e.g. "a") and then run the command but then again not familar with how to replace the same
---------- Post updated 07-17-14 at 12:32 AM ---------- Previous update was 07-16-14 at 11:27 PM ----------
Looking around the net I found couple of approaches which I can use on the same lines perl solution was suggested.
To find out the lines having extended ascii characters
To replace the extended ascii character with a single byte character(a).
and once its done the wc can be used on the resultant file.
This approach seems to be working fine for me. Please suggest if there is a better approach that can be used.
Just a longhand very quick example; OSX 10.7.5, default bash terminal:-
Results:- ---------- Post updated at 12:24 PM ---------- Previous update was at 08:11 AM ----------
Using CygWin, default bash terminal manually:-
Last edited by wisecracker; 07-17-2014 at 08:25 AM..
Reason: See above...
Hello,
I am on AIX.
When I encounter extended ascii characters and special characters on a file I need to print..
Byte position, actual character and line number.
Is there a simple command that can give me the above result ?
Thanks in advance (38 Replies)
I am working with a log file that I am trying to clean up by removing non-English ASCII characters. I am using Bash via Cygwin on Windows.
Before I start I set:
export LC_ALL=C
I clean it up by removing all non-English ASCII characters with the following command;
grep -v $''... (4 Replies)
Hi All,
I am trying to remove (SELECTIVE - passed as argument) Extended ASCII using Awk based on adhoc basis. Can you please let me know how to do it. I have to implement this using awk only.
Thanks & Regads (14 Replies)
Hi,
I want to read extended ASCII characters from keyboard using c language on unix/linux. How to read extended characters from keyboard or by copy-paste in terminal irrespective of locale set in the system. I want to read the input characters from keyboard, store it in an array or some local... (3 Replies)
We are getting extended Ascii characters in the input file and my requirement is to search and replace them with a space. I am using the following command
LANG=C sed -e 's// /g'
It is doing a good job, but in some cases it is replacing the extended characters with two spaces. So my input... (12 Replies)
Hi All,
I'm trying to send extended ascii characters to my HP2055 as part of PCL printer control codes. What I want to do is select a bar code font, print the bar code and reset the printer to the default font.
Selecting the bar code font works good. Printing the bar code goes almost ok too. ... (5 Replies)
Hi, I have a accentuated letter (ö) in a script for an Installer. It's a file name. This is not working and I'm told to try using the octal value for the extended ascii character. Does anyone no how to do this? If I had the word "filförval", can I just put in the value between the letters, like... (9 Replies)
hi i would like to check text files if they contain extended ascii characters within or not. i really dont have any idea how to start your kind help would be very much appreciated thanks. (7 Replies)
Hi all,
I would like to change the extended ascii code ( 128 - 255).
I tried to change LC_ALL and LANG in current session ( values from locale -a) and for no good.
Thanks. (0 Replies)