Sponsored Content
Top Forums Shell Programming and Scripting how to check string of character Post 302139290 by manas_ranjan on Friday 5th of October 2007 07:35:37 AM
Old 10-05-2007
hey.......i did the same thing before posting this let me clear one more time...not successful.......only i sud display abc......
is there any way to find only alphabets.....

for your satisfaction....

[:alpha:] := all letters including digit too

so i request you please go thru the query/questions.....where i clearly mentioned i need only character sets......even though my variable has alphanumeric/numeric/ i sud say please enter valid characters
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

check for the first character to be blank

I'm having a problem when the first line or first character of a file is blank. I need to get rid of both of them when they occur but don't want to delete the line. Does anyone have any suggestions? (7 Replies)
Discussion started by: anthreedhr
7 Replies

2. Programming

converting character string to hex string

HI Hi I have a character string which contains some special characters and I need it to display as a hex string. For example, the sample i/p string: ×¥ïA Å gïÛý and the o/p should be : D7A5EF4100C5010067EFDBFD Any pointers or sample code pls. (5 Replies)
Discussion started by: axes
5 Replies

3. Shell Programming and Scripting

read string, check string length and cut

Hello All, Plz help me with: I have a csv file with data separated by ',' and optionally enclosed by "". I want to check each of these values to see if they exceed the specified string length, and if they do I want to cut just that value to the max length allowed and keep the csv format as it... (9 Replies)
Discussion started by: ozzy80
9 Replies

4. Shell Programming and Scripting

bash script to check the first character in string

Hello would appreciate if somebody can post a bash script that checks if the first character of the given string is equal to, say, "a" thnx in advance (2 Replies)
Discussion started by: ole111
2 Replies

5. AIX

check for a particular character inside a file and substitute with a given character?

i am a newbie to shell script,so i want a kshell script in which i need to check for a particular character inside a file through conditional looping(like if ,case,while)and if that character exists ,then substitute a given character to that character. consider a file test.txt,inside the file... (1 Reply)
Discussion started by: karthikprasathk
1 Replies

6. Shell Programming and Scripting

Korn: How to loop through a string character by character

If I have a string defined as: MyString=abcde echo $MyString How can I loop through it character by character? I haven't been able to find a way to index the string so that I loop through it. shew01 (10 Replies)
Discussion started by: shew01
10 Replies

7. Shell Programming and Scripting

check number of character

hi, I would like to calculate number of character for a number, for exemple : 1200 --> there are 4 characters , 120001 -> 5 characters (4 Replies)
Discussion started by: francis_tom
4 Replies

8. Shell Programming and Scripting

How to check for special character in a value

Hi, I have a variable and to it always alphanumeric value will be assigned. If the value has any special characters in it then in the if statement it should exit like below if (value has any speacial character) then exit else .... fi can any one suggest how to acheive this? (4 Replies)
Discussion started by: lavnayas
4 Replies

9. Shell Programming and Scripting

Check file for string existence before appending it with string

I want to append file with a string but before doing that i want to check if this string already exist in that file.I tried with grep on Solaris 10 but unsuccessful.Man pages from grep seems to suggest if the string is found command status will be 0 and if not 1.But i am not finding it.May be i... (2 Replies)
Discussion started by: sahil_shine
2 Replies

10. Shell Programming and Scripting

sed searches a character string for a specified delimiter character, and returns a leading or traili

Hi, Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank. Text file : "1"|"ExternalClassDEA519CF5"|"Art1" "2"|"ExternalClass563EA516C"|"Art3" "3"|"ExternalClass305ED16B8"|"Art9" ... ... ... (2 Replies)
Discussion started by: fspalero
2 Replies
ctype(3)						     Library Functions Manual							  ctype(3)

Name
       isalpha,  isupper,  islower,  isdigit,  isxdigit,  isalnum, isspace, ispunct, isprint, isgraph, iscntrl, isascii - character classification
       macros

Syntax
       #include <ctype.h>

       int isalpha (c)

       int c;

Description
       These macros classify character-coded integer values according to the rules of the coded character set (codeset)  identified  by  the  last
       successful call to category All macros return non-zero for true and zero for false.

       If  category  has  not been called successfully, or if character classification information is not available for a supported language, then
       characters are classified according to the rules of the ASCII 7-bit coded character set, returning 0 for values above octal 0177.

       The macro provides a result for all integer values.  The rest provide a result for EOF and values in the character  range  of  the  codeset
       identified by the last successful call to category

       c	      is a letter

       c	      is an uppercase letter

       c	      is a lowercase letter

       c	      is a digit

       c	      is a hexadecimal digit, by default [0-9], [A-F], or [a-f]

       c	      is an alphanumeric character

       c	      is a space, tab, carriage return, new line, or form feed

       c	      is a punctuation character (neither control, alphanumeric, nor space)

       c	      is a printing character, by default code 040(8) (space) through 0176 (tilde)

       c	      is a printing character, like except false for space

       c	      is a delete character(0177) or ordinary control character (less than 040) except for space characters

       c	      is an ASCII character, code less than 0200

   International Environment
       LC_CTYPE       If this environment variable is set and valid, uses the international language database named in the definition to determine
		      character classification rules.

       LANG	      If this environment variable is set and valid, uses the international language database named in the definition to determine
		      the character classification rules. If is defined, that definition supercedes the definition of

See Also
       conv(3), setlocale(3), stdio(3s), environ(5int), ascii(7)
       Guide to Developing International Software

																	  ctype(3)
All times are GMT -4. The time now is 08:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy