Sponsored Content
Top Forums Shell Programming and Scripting Print the next ASCII character Post 302594404 by methyl on Tuesday 31st of January 2012 09:02:13 AM
Old 01-31-2012
A unix way with "tr": Assumes columns 1 and 4 are always numbers and columns 2,3 and 5 are always lower-case letters.
Code:
cat input.txt | tr '[abcdefghijklmnopqrstuvwxyz]' '[bcdefghijklmnopqrstuvwxyza]' >output.txt

This User Gave Thanks to methyl For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ASCII character to accept logon password

Hey all, Just found your forum...Looks super rich with info! Can't wait to get through it all. I am currently writing a web app in .net that telnets into a unix server (require uid + passwd), runs a command, and returns that output to be displayed on the web page. I have gotten through the... (8 Replies)
Discussion started by: gord
8 Replies

2. UNIX for Dummies Questions & Answers

Non-ascii character detection (perl or grep)

Hi, Can I know how to grep for lines with non-ascii characters in a file? If not grep, at least can we do it with command-line perl or awk? I tried the functionality of perl, but still could not get the result. Any help?? PS: I was sure that someone should have asked this question... (9 Replies)
Discussion started by: srinivasan_85
9 Replies

3. UNIX for Dummies Questions & Answers

Ascii value of character?

Is there a way to determine the ascii value of a character? For example, let's say a shell variable has the value 'A'. I would like it's ascii value (e.g. 65 in this case). I would like to do this from a script (preferably ksh). (12 Replies)
Discussion started by: sszd
12 Replies

4. Shell Programming and Scripting

read in a file character by character - replace any unknown ASCII characters with spa

Can someone help me to write a script / command to read in a file, character by character, replace any unknown ASCII characters with space. then write out the file to a new filename/ Thanks! (1 Reply)
Discussion started by: raghav525
1 Replies

5. UNIX for Advanced & Expert Users

ASCII Character Set

I thought I would point this out. This has a lot of the non printing characters. ASCII Character Set (7 Replies)
Discussion started by: cokedude
7 Replies

6. UNIX for Dummies Questions & Answers

How to grep for a non-standard ASCII character?

A very simple question but I have scoured the web and can't find an answer. How do I search for a character by ASCII code in a regular expression using grep? For example, we use the End of Medium symbol as a delimiter in certain files. (this is ascii 031 in oct, displays as ^Y) I want to grep... (6 Replies)
Discussion started by: DJR
6 Replies

7. Shell Programming and Scripting

FTP Issue with Non ascii character

I have one file .dat file on windows server containg the following text "Bürki" Now When I am using FTP (get) command from UNIX server the text is appering is as "Bürki" I want to preserve the text in the file on UNIX server as it is in source file. Could you please suggest some... (2 Replies)
Discussion started by: Bhushan D
2 Replies

8. Shell Programming and Scripting

Remove some special ascii character

Hello I have this special caracter after retreving rows from sql server: "....spasses: • Entrem al valort 6050108002811 • El donem..." I would like a sed command to remove it..or just know it's ascii code in order to replace it into my sql sentence.. Hope some one knows how to do that.... (7 Replies)
Discussion started by: ldiaz2106
7 Replies

9. UNIX for Dummies Questions & Answers

What is ASCII character?

Hi Guru, I have put one post yesterday and get answer. thanks for your help. my question today is: what is ascii character for following non printable characters: ( we need filter these characters out in another process) ^MM-^E^MM-^E. Old post link: ... (5 Replies)
Discussion started by: ken002
5 Replies

10. UNIX for Beginners Questions & Answers

Print byte position of extended ascii character

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)
Discussion started by: rosebud123
38 Replies
ctype(3C)																 ctype(3C)

NAME
ctype: isalnum(), isalpha(), isascii(), isblank(), iscntrl(), isdigit(), isgraph(), islower(), isprint(), ispunct(), isspace(), isupper(), isxdigit() - classify characters according to type SYNOPSIS
DESCRIPTION
These functions classify character-coded integer values according to the rules of the coded character set identified by the last successful call to (see setlocale(3C)). Each function is a predicate returning nonzero for true, zero for false. If has not been called successfully, characters are classified according to the rules of the default ASCII 7-bit coded character set (see setlocale(3C)). is defined on all integer values; the other functions are defined for the range (EOF) through RETURN VALUE
The functions return nonzero under the following circumstances; zero otherwise: c is an alphanumeric (letters or digits). c is a letter. c is any ASCII character code between 0 and 0177, inclusive. c is a blank character; that is, a space or a tab. c is a control character (in ASCII: character codes less than 040 and the delete character(0177)). c is a decimal digit (in ASCII: characters [0-9]). c is a visible character (in ASCII: printing characters, excluding the space character(040)). c is a lowercase letter. c is a printing character. c is a punctuation character (in ASCII: any printing character except the space character(040), digits, letters). c is a character that creates whitespace in displayed text (in ASCII: space, tab, carriage return, newline, verti- cal tab, and formfeed). c is an uppercase letter. c is a hexadecimal digit (in ASCII: characters [0-9], [A-F] or [a-f]). If the argument to any of these functions is outside the domain of the function, the result is undefined. EXTERNAL INFLUENCES
Environment Variables The category determines the classification of character type. International Code Set Support Single-byte character code sets are supported. WARNINGS
These functions are supplied both as library functions and as macros defined in the header. Normally, the macro versions are used. To obtain the library function, either use a to remove the macro definition or, if compiling in ANSI-C mode, enclose the function name in parenthesis or take its address. The following example uses the library functions for and AUTHOR
was developed by IBM, OSF, and HP. SEE ALSO
setlocale(3C), ascii(5), thread_safety(5). STANDARDS CONFORMANCE
ctype(3C)
All times are GMT -4. The time now is 10:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy