Convert ascii character values to number that comes between the numbers in UNIX

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Convert ascii character values to number that comes between the numbers in UNIX
# 1  
Old 04-08-2016
Convert ascii character values to number that comes between the numbers in UNIX

I have variable that contains multiple values of number and also include overpunch(i.e. # $ % etc) character so we want to replace it with numbers.
here are the example:

Code:
Code:
11500#.0#
28575$.5$
527#.7#
42".2"
2794 .4
2279!.9!
1067&.7&
926#.6#
2279!.9!
885".5"
11714$.4$
27361'.1'
2%.2%
533".3"

like :
$ascii_value = 886%.6% would be 88637.637

could you please help me out.

---------- Post updated 04-08-16 at 12:06 AM ---------- Previous update was 04-07-16 at 12:56 PM ----------

Can anyone help me!!!SmilieSmilieSmilie

Last edited by nadeemrafikhan; 04-07-2016 at 03:03 PM..
# 2  
Old 04-08-2016
Moderator's Comments:
Mod Comment This thread duplicates a discussion started in the thread Convert Overpunch character values to number that comes between the numbers in perl. Continue any discussion on this topic in that thread.

This thread is closed.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to convert \n character to newline in UNIX.

I have a variable like below: str1="10.9.11.128\n-rwxr-xr-x user1 2019-12-29 17:53 /var/branch/custom/tg.xml 286030210\n10.9.12.129\n-rwxr-xr-x user1 2019-12-29 17:53 /app/branch/custom/tg.xml 286030210\n10.9.20.130\n-rwxr-xr-x user1 2019-12-29 17:53 /web/branch/custom/tg.xml 286030210" I... (8 Replies)
Discussion started by: mohtashims
8 Replies

2. Shell Programming and Scripting

Convert Hex to Ascii in a Ascii file

Hi All, I have an ascii file in which few columns are having hex values which i need to convert into ascii. Kindly suggest me what command can be used in unix shell scripting? Thanks in Advance (2 Replies)
Discussion started by: HemaV
2 Replies

3. UNIX for Beginners Questions & Answers

Convert Overpunch character values to number that comes between the numbers in perl

I have variable that contains multiple values of number and also includeOverpunch character so we want to replace it with numbers. here are the example: 11500#.0# 28575$.5$ 527#.7# 42".2" 2794 .4 2279!.9! 1067&.7& 926#.6# 2279!.9! 885".5" 11714$.4$ 27361'.1' 2%.2% 533".3" ... (18 Replies)
Discussion started by: nadeemrafikhan
18 Replies

4. Shell Programming and Scripting

Convert UNIX rights in a number in a sh script

Hello, i'm trying to write a script sh to convert the rights of a folder or file in a number. Explain: ls -l = rwxrwxrwx so i must display 777. Do you known where i can find so convert script Thanks Use code tags, thanks. (11 Replies)
Discussion started by: steiner
11 Replies

5. Shell Programming and Scripting

convert ascii values into ascii characters

Hi gurus, I have a file in unix with ascii values. I need to convert all the ascii values in the file to ascii characters. File contains nearly 20000 records with ascii values. (10 Replies)
Discussion started by: sandeeppvk
10 Replies

6. 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

7. Shell Programming and Scripting

why convert 8 space to 1 tab character on unix?

Hi everybody, I'm using Hp unix tru64. I have generate one file from shell script. bus that file content pre "8 space char" convert one tab character. why? result file hex format: hex 20 20 20 20 20 to 09 (6 Replies)
Discussion started by: Tlg13team
6 Replies

8. Programming

To convert UHF-8 to ASCII using C++

Hi, I have two strings aaa, bbb which contains text in UTF-8 format. I am using Solaris OS. zsh shell, emacs editor. In the shell the text are represented like "fff'''(((#ip##iii^q##1..... Example: aaa="fff'''(((#ip##iii^q##1".. I need to compare the two strings, I feel that text in this... (3 Replies)
Discussion started by: SamRoj
3 Replies

9. UNIX for Advanced & Expert Users

Processing extended ascii character file names in UNIX (BASH scipts)

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)
Discussion started by: peli
9 Replies

10. UNIX for Advanced & Expert Users

Converting Binary decimal coded values to Ascii Values

Hi All, Is there any command which can convert binary decimal coded values to ascii values... i have bcd values like below îîîîîîîîîîîî0î-- -v - Pls suggest a way to convert this. Thanks, Deepti.Gaur (3 Replies)
Discussion started by: gaur.deepti
3 Replies
Login or Register to Ask a Question