Decimal value for special character


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Decimal value for special character
# 8  
Old 06-03-2011
Quote:
Originally Posted by panyam
var="a";printf "%d", "${var}"

Doesn't seem to work

Here is the output:

Quote:
Unixbox:/home/user $ var="a";printf "%d", "${var}"
printf: a expected numeric value
0,Unixbox:/home/user $

Was expecting 65 as output
# 9  
Old 06-03-2011
Hi.

I suggest:
Code:
ascii o376
ASCII 15/14 is decimal 254, hex fe, octal 376, bits 11111110: meta-~

See man ascii for details ... cheers, drl
# 10  
Old 06-03-2011
My main problem is this special character "þ" in file.

I dont know what it is.

I am trying to find the decimal value for this. So that i can convert this special character to new line character in DataStage.

DataStage only like Decimal values for special characters.

For example : For CTRL-Y datastage reads it as char(25)

Help on this is appreciated.
# 11  
Old 06-03-2011
Quote:
Originally Posted by pinnacle
I am trying to find the decimal value for this. So that i can convert this special character to new line character in DataStage.

DataStage only like Decimal values for special characters.

For example : For CTRL-Y datastage reads it as char(25)

Help on this is appreciated.
Posters fpmurphy and drl have already told you the answer to that...but for some reason you havent taken the time to read their posts. The decimal value of 376 is 254 and take sometime to become familiar with base conversions otherwise you will get stuck again somewhere.
# 12  
Old 06-05-2011
Quote:
Originally Posted by shamrock
Posters fpmurphy and drl have already told you the answer to that...but for some reason you havent taken the time to read their posts. The decimal value of 376 is 254 and take sometime to become familiar with base conversions otherwise you will get stuck again somewhere.

Thank You i read those post but did not understand them earlier.

Sorry about that.

Will read base conversion.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Special character $$

Hi, on ksh What does the following do? grep -v "toolbox" $home_oracle/.profile >$home_oracle/.profile.$$ Thanks. Please use CODE tags as required by forum rules! (3 Replies)
Discussion started by: big123456
3 Replies

2. Shell Programming and Scripting

^M special character in Filename

Hi All, Special character ? is added in between filename. Am not able to figure our why this is happening. In my Development environment special characters are not present. This issue is happening in the higher environment. It would be helpful if somebody can tell what are the possible... (3 Replies)
Discussion started by: weknowd
3 Replies

3. Shell Programming and Scripting

Use decimal value of array in bc ends with illegal character

hi all I have to read a long cvs file every 4 columns with decimal "3,45" numbers. The 9th row in this cvs is the first line I need, so it I tail -n+9. I use sed -e 's/,/./g' to get decimal values with . delimiter. So far no problem. Goal is to get two maximum negative forces in ranges... (5 Replies)
Discussion started by: Grille
5 Replies

4. Shell Programming and Scripting

Vi special character

When editing a file, vi displays a special character as ^L. Can you tell me the escaped character to be used in awk? And can that escaped character be used in a regexp in both sed and awk? (7 Replies)
Discussion started by: dmesserly
7 Replies

5. Shell Programming and Scripting

need help in expanding hexa decimal character range

Hi all, I have a input like this 3AF9:3B01 and need to expand to the below output 3AF9 3AFA 3AFB 3AFC 3AFD 3AFE 3AFF 3B00 3B01 Please let me know the easiest way for achieving this. Thanks for the help in advance... (6 Replies)
Discussion started by: leo.maveriick
6 Replies

6. Shell Programming and Scripting

Deleteing one character after an special character

I have below line in a unix file, I want to delete one character after "Â". 20091020.Non-Agency CMO Daily Trade Recap Â~V Hybrids The result should be : 20091020.Non-Agency CMO Daily Trade Recap  Hybrids i dont want to use "~V" anywhere in the sed command or any other command, just remove... (1 Reply)
Discussion started by: mohsin.quazi
1 Replies

7. Shell Programming and Scripting

Special character \

Hi, In the shell script, i need to remove the special charater "\" with "\\". For example, i need to replace "D:\FXT\ABC.TXT" with "D:\\FXT\\ABC.TXT". However, when trying to do something like , i get the below error :- -->echo "D:\FXT\ABC.TXT" | sed -e 's#\#\\#g' sed: 0602-404 Function... (7 Replies)
Discussion started by: amit_arora
7 Replies

8. Shell Programming and Scripting

special character

Hi, I am trying to unload file from a database. Which contains few lines with the character below. Rest of the data was unloaded appropriately. a) What does this below character means? b) How can i remove it, I already have sed '/^$/d' c) Will this effect the file by any means... (4 Replies)
Discussion started by: tostay2003
4 Replies

9. Shell Programming and Scripting

How To Make Decimal Point Fall On The 15th Character On The Screen

If i have a variable which is a decimal number, i.e 34.05 How can you make decimal point fall on the 15th character on the screen? Or any other that you can specify? Can you do it using sed or awk? (3 Replies)
Discussion started by: Vozx
3 Replies

10. Programming

special character ?

hey there im a bit stuck on executing commands that include the special character '?'. can someone recommend a way on how i would be able to execute it?? i thought the glob function could be useful (still mite be) but upon entering the command 'ls pars?' it listed all the files in the... (1 Reply)
Discussion started by: mile1982
1 Replies
Login or Register to Ask a Question