laiki
laiki

Reputation: 39

convert ascii representing hex values to binary data

I'm searching a way to convert ascii data representing hex values to binary files. In detail, all communication on a serial port to a connected def vice (in this case a GPS receiver) is been logged by converting the hex values to strings. What I'm looking for is a way to convert this data back to binary data. Basically I'm able to do this running HxD editor and past the string extracted from the log. HxD representation of 2 line logged

What I would like to do is being able to do this on command line to not need manually to copy/paste the test to the hex editor.

The lines always start wi B562 followed by values e.g. 06 which in such case should result in an output (represented as string) of 'µb.'

As an example I'm edding a file which contains the data I want to convert, and athe resulting file as it is written by the HxD editor. This resulting file can be opened and replayed by a tool provided by u.blox.com called u-center. It shows the satelite informations being recorded ... input file log01.ublox.tmp output file log01.ubx

Thanks for any support. - Wasili

Upvotes: 1

Views: 2825

Answers (1)

tshiono
tshiono

Reputation: 22012

You can use the following to convert ASCII representing hex values to binary data:

xxd -r -ps log01.ublox.tmp output.ubx

Upvotes: 3

Related Questions