The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to replace any char with newline char. mightysam Shell Programming and Scripting 5 09-18-2008 08:15 PM
char c = 882 useless79 High Level Programming 1 07-30-2007 05:16 AM
char *p and char p[]. arunviswanath High Level Programming 4 07-20-2006 02:11 AM
how to convert char to num guhas Shell Programming and Scripting 2 09-12-2005 04:30 AM
\n char in C C|[anti-trust] High Level Programming 1 05-05-2005 06:15 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-09-2005
jasmine05 jasmine05 is offline
Registered User
  
 

Join Date: Jun 2005
Posts: 3
Convert Char to Dec using AWK

I'm facing a problem when trying to read a file and convert the content from char to decimal in ASCII.

eg :-
Input file :
20051231 8.00

experted result :
50484853495051493256464848

The content of input file is vary very day.
I need to use AWK script to program it.
Pls help. TQ....
  #2 (permalink)  
Old 06-09-2005
r2007's Avatar
r2007 r2007 is offline
Registered User
  
 

Join Date: Jun 2005
Location: China
Posts: 73
I suggest using od instead of awk.
  #3 (permalink)  
Old 06-09-2005
jasmine05 jasmine05 is offline
Registered User
  
 

Join Date: Jun 2005
Posts: 3
I have try but not the result i want!!
$)cat a
20051231 8.00

When I try as below:-
$)od -d a
0000000 12848 12341 12594 13105 08248 11824 12298
0000016

any other command can use?
  #4 (permalink)  
Old 06-09-2005
r2007's Avatar
r2007 r2007 is offline
Registered User
  
 

Join Date: Jun 2005
Location: China
Posts: 73
Code:
od -A n -t u1 <urfile>
Quote:
od --version
od (coreutils) 5.0
Written by Jim Meyering.
  #5 (permalink)  
Old 06-09-2005
jasmine05 jasmine05 is offline
Registered User
  
 

Join Date: Jun 2005
Posts: 3
ok i get it.
TQ.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:58 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0