decimal value for particular characterset


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting decimal value for particular characterset
# 1  
Old 06-20-2011
decimal value for particular characterset

Hi,

I need some help to get decimal value of some particluar character set

for e.g.

in windows-1251 characterset

Code:
ж --> 230

Please help and suggest way to achive same.
# 2  
Old 06-20-2011
i dont understand your question.

please explain little more
# 3  
Old 06-20-2011
Code:
$ echo  -n a | od -i
0000000          97
0000001
$echo  -n b | od -i
0000000          98
0000001

# 4  
Old 06-21-2011
Quote:
Originally Posted by itkamaraj
i dont understand your question.

please explain little more

Actually i want to extract decimal value for each character of certain characterset file(e.g file in windows-1251 characterset)

---------- Post updated at 11:37 AM ---------- Previous update was at 11:35 AM ----------

Quote:
Originally Posted by honglus
Code:
$ echo  -n a | od -i
0000000          97
0000001
$echo  -n b | od -i
0000000          98
0000001


Hi,

here you are converting ascii character to equivalent decimal character.
I need to convert windows-1251 characterset to decimal equivalent

---------- Post updated 06-21-11 at 08:41 AM ---------- Previous update was 06-20-11 at 11:37 AM ----------

Any help with that would be greatly appreciated.
# 5  
Old 06-21-2011
Code:
% echo -n 'фыва' | iconv -futf-8 -tcp1251 | od -An -tu1 -w1

# 6  
Old 06-21-2011
hi yazu,

thanks for reply, i will check and reply soon.

Piyush

---------- Post updated at 11:27 AM ---------- Previous update was at 10:18 AM ----------

Hi yazu,

Quote:
Originally Posted by yazu
Code:
% echo -n 'фыва' | iconv -futf-8 -tcp1251 | od -An -tu1 -w1

this works great...
thanks for support

is there some way to convert native character with provided decimal value, just opposit of above
# 7  
Old 06-21-2011
Code:
% echo ' 244
 251
 226
 224'| perl -lne 'BEGIN {use POSIX qw(locale_h); setlocale LC_CTYPE, cp1251 }; print chr'  | iconv -fcp1251 -tutf-8
ф
ы
в
а

Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sum the fields with 6 decimal places - getting only 2 decimal places as output

I used the below script to Sum up a field in a file based on some unique values. But the problem is when it is summing up the units, it is truncating to 2 decimals and not 6 decimals as in the input file (Input file has the units with up to 6 Decimals – Sample data below, when the units in the 2... (4 Replies)
Discussion started by: brlsubbu
4 Replies

2. Shell Programming and Scripting

Decimal Padding in Decimal

Hi Experts, I have requirement to pad a decimal number that should have fixed length as 10. if number is 234.234 > 234.234000 if number is 12.4 > 12.4000000 if number is 3456.5678 > 3456.56780 from above example we can see that overall length is 10 and padding is being done right sided of... (2 Replies)
Discussion started by: looney
2 Replies

3. Programming

Urgent help needed.. C++ program to convert decimal to hexa decimal

Hi , seq can be 0...128 int windex = seq / 8; int bindex = seq % 8; unsigned char bitvalue = '\x01' << (7-bindex) ; bpv.bitmapvalue = bitvalue; This is the part of a program to convert decimal to bitmap value of hexadecimal. I want this to change to convert only to... (1 Reply)
Discussion started by: greenworld123
1 Replies

4. UNIX for Dummies Questions & Answers

Convert hexa decimal to decimal

Hi, I want to convert two hexadecimal numbers to decimal using unix command line. 1cce446295197a9d6352f9f223a9b698 fc8f99ac06e88c4faf669cf366f60d I tried using `echo "ibase=16; $no |bc` printf '%x\n' "1cce446295197a9d6352f9f223a9b698" but it doesn't work for such big number it... (4 Replies)
Discussion started by: sudhakar T
4 Replies

5. Shell Programming and Scripting

Characterset conversion problem using iconv command

Hi Friends, I am not able to conver character set from UTF-8 to IBM-284 throwing an error "cannot open convertor" . Could you please help me how to get out of this error. Below command is working fine iconv -f ISO8859-15 -t UTF-8 fromfile.txt > tofile.txt But the below command is... (2 Replies)
Discussion started by: sivakumarl
2 Replies

6. Homework & Coursework Questions

Decimal to BCD (Binary Coded Decimal)

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Design an algorithm that accepts an input a decimal number and converts it into BCD (Binary... (2 Replies)
Discussion started by: caramba
2 Replies

7. UNIX for Dummies Questions & Answers

Decimal to BCD (Binary Coded Decimal)

Anybody please help me... Design an algorithm that accepts an input a decimal number and converts it into BCD (Binary Coded Decimal) representation. Also, draw its Flow Chart. This is a unix qn... plz post algorithm for that :confused: (1 Reply)
Discussion started by: caramba
1 Replies

8. Shell Programming and Scripting

Decimal format

Hello Friends, I have a file with below format... 1234,Hary,102.55 4567,Maria,250.40 78942,suzan,261.60 48965,Harun,179.32 And I want to check the last column. If the decimal value of the last column is below 50, I need that column else ignore that column. Can anyone help me out? (3 Replies)
Discussion started by: mziaullah
3 Replies
Login or Register to Ask a Question