Swapping a string of numbers between higher and lower order values(HEX)
I have this below string in a variable
this string is nothing but hex values depicted as below
so what i want to achieve is swap the lower order with higher order values in the string
let me give you another exaample
also i need to do one more implementation
first i need to store this convertted output in one variable say nextString
later i need to introduce a space between each byte as below so that i can loop it in for loop and perform some operation..(PS: there shouldnt be an extra space at the end of string)
any help is deeply appreciated. thanks.
even if i can just learn how to introucde spaces, i can handle swapping in for loop by myself. :-)
This is very basic. Yet Iam struggling to get the right pattern for my check.
Apologize in advance to ask a very lame question.
I have to validate if a value of the variable starts with "efgh" and followed by 6 numbers.
Var1="efgh234567"
The condition Iam trying to achieve is similar to... (6 Replies)
Assume I have a file \usr\home\\somedir\myfile123.txt
and I want to replace all occurencies of the two (concatenated) hex values x'AD' x'A0' bytwo other (concatenated) hex values x'20' x'6E'
How can I achieve this with the gnu sed tool?
Additional question: Is there a way to let sed show... (1 Reply)
Hi All,
newbie here, i'm just wondering how can i swap the two values of variables without using the third variable.
Please advise,
Thanks, (5 Replies)
Hi all
we have a file ONE like this
12345 98765
67222 74252
76991 90091
and we have one more file TWO like
huiiii 67jjjj u988 99999 uj99j 98765
hujg 7yhh ij999 78688 ijo99 74252
Now i want create THREE file which
is like
huiiii 67jjjj u988 12345 uj99j 98765
hujg 7yhh ij999... (2 Replies)
Hi
I would like to test for a max number value. It may be a decimal so I know I have to pipe into bc.
I just cannot get the syntax for this to work. I cannot get passed an error with the bracket - see below.
Any help appreciated.
Regards
Ewan
This works:
/export/home/ewan> cat... (5 Replies)
Hi,
I am a bit stuck with displaying characters. I am having values like below in the proper displayable characters. which I would want to print the actual value on the right hand side. I dont want to create an array because I would have to create 255 different values. isnt there another way of... (17 Replies)
Hi,
please tell me how to convert hex number to decimal
000000E7
000000000002640D
0000000000025B16
and seconds to minutes, hours, days, months, years
bytes to kbytes, mbytes , gbytes
read the following examples
while read a b
do
printf "%5d %5d\n" "0x$a" "0x$b"
done < "$FILE"... (15 Replies)
Hi,
If i have an input as
c1:41 c2:0x0000.00046b3e
I want to make output display as
c1:41 c2:224062
.
Basically convert first part 0x0000 (as hex) to decimal which is 0 and
convert second part 0x00046b3e (as hex) to decimal which is 289598
and as such add both parts namely... (3 Replies)
typeset -i A=16#0
typeset -u A=$a
y=${A#16#}
This converted $a to hex and stored it in y.
Can someone walk me through how this was done?
thanks (2 Replies)