LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-21-2012, 02:20 AM   #1
mayurirao
LQ Newbie
 
Registered: Mar 2012
Posts: 4

Rep: Reputation: Disabled
reversing a hexadecimal string in shell


Hello
I help with doing the following..
I have a table in a text file like this

blah blah 6F1A010105 12346F
blah blah 4A1F010206 32141A
...
...

I need to do the following.

1) In the third column the bytes are reversed eg) Row1 Col3 should read as 0501011A6F
2) Convert the order corrected third column and the fourth column to decimal

How would I do this.
The output should be written into a file with the 3 and 4th column replaced by the decimal values

- Thanks
 
Old 03-21-2012, 03:19 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,250

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
Pretty much pick a language, perl, python, ruby, or even awk can probably do what you need. What do you have strengths in and what have you tried?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
reversing string with space lipun4u Linux - Newbie 2 02-16-2010 01:41 AM
Reversing a string using only commands from the SUS (Single UNIX Specification) Willard Programming 6 11-17-2009 12:30 PM
convert string to hexadecimal kpachopoulos Programming 3 12-11-2007 07:23 AM
Comparison between character and hexadecimal string.. vishalbutte Programming 2 03-05-2006 08:59 PM
converting integer value to hexadecimal string in C - any suggestions?? woodywellhung Programming 3 04-24-2004 06:27 PM


All times are GMT -5. The time now is 06:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration