L
LinuxSunday
After giving some system cmd, I will be getting the o/p which will be
exactly like below. ie., 16 bytes in each line. Here you see 4 lines
of 16bytes each. The o/p given here is Hex coded ascii values.
I need to parse their values and convert into their string values. The
o/p given by the system is as follows.
3e 53 31 37 50 37 35 37 36 59 4d 31 30 4d 5a 33
38 53 30 30 37 31 37 50 37 35 37 36 20 48 38 33
32 32 39 20 50 57 52 2f 46 41 4e 20 53 45 4e 53
45 20 43 41 52 44 20 00 00 00 00 00 00 00 00 33
The starting byte 3e is the 0th byte will tell you how many bytes are
necessary to read or present. here 0x3e is 62(decimal) number of
bytes. so it starts from 0th byte to 61 bytes. This information may
not be necessary, but just FYI.
I need to do the following.
from 1th to 20th byte represents the NameOfProduct[25] which is
53 31 37 50 37 35 37 36 59 4d 31 30 4d 5a 33 38 53 30 30 37 - Hex
coded Ascii
21th - 28th byte is NumberOfProduct[10] which is 31 37 50 37
35 37 36 20 - Ascii
29th - 35th byte is serialNumber[10] 48 38 33 32 32 39 20 - Ascii
Help me in getting these values in an efficient way and stored in to
the string of characters.
Thanks,
LinuxSunday
exactly like below. ie., 16 bytes in each line. Here you see 4 lines
of 16bytes each. The o/p given here is Hex coded ascii values.
I need to parse their values and convert into their string values. The
o/p given by the system is as follows.
3e 53 31 37 50 37 35 37 36 59 4d 31 30 4d 5a 33
38 53 30 30 37 31 37 50 37 35 37 36 20 48 38 33
32 32 39 20 50 57 52 2f 46 41 4e 20 53 45 4e 53
45 20 43 41 52 44 20 00 00 00 00 00 00 00 00 33
The starting byte 3e is the 0th byte will tell you how many bytes are
necessary to read or present. here 0x3e is 62(decimal) number of
bytes. so it starts from 0th byte to 61 bytes. This information may
not be necessary, but just FYI.
I need to do the following.
from 1th to 20th byte represents the NameOfProduct[25] which is
53 31 37 50 37 35 37 36 59 4d 31 30 4d 5a 33 38 53 30 30 37 - Hex
coded Ascii
21th - 28th byte is NumberOfProduct[10] which is 31 37 50 37
35 37 36 20 - Ascii
29th - 35th byte is serialNumber[10] 48 38 33 32 32 39 20 - Ascii
Help me in getting these values in an efficient way and stored in to
the string of characters.
Thanks,
LinuxSunday