Page 1 of 1

LSB & MSB in text join

Posted: Tue Nov 12, 2013 5:00 pm
by VX L67 Getrag
Does anyone know an easy way to join these 2 text files as 1 complete bin?

It was a bit of a mission even getting them to this stage!

TIA for any tips

Re: LSB & MSB in text join

Posted: Tue Nov 12, 2013 7:39 pm
by festy
Is this what you're after?

Code: Select all

FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
2301 01F4 5F02 503C 6E64 0000 1300 01F4
C801 503C 6E64 0000 03E8 03E8 03E8 000A
000C FFE0 0000 000A 0100 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0F14 0F14 0603 6420 143C
3E04 4040 3C3F 393B 3235 3031 3430 6636
FB77 071F 2806 0040 0064 350E 4A25 484B
4243 393C 2D3B 2E2D 2F2E 2B2C 2B2B 2D2C
0031 0000 17BD 7410 503C 6A55 7973 6A29
5966 0068 7020 5F65 006E 6839 AB81 59F3
FF10 130A 0096 6237 C495 59F5 FF10 130A
1E8C 7561 9208 2200 08DE 0000 6996 2944
0201 3200 0000 0000 81FF E102 0100 A0F1

Re: LSB & MSB in text join

Posted: Tue Nov 12, 2013 8:47 pm
by VX L67 Getrag
Yeah thats exactly it was it easy to do or a bit of a pain, as I have the original file & a few of them that I had to convert to that format & then whatever you did!

This was basically the original format....

Re: LSB & MSB in text join

Posted: Tue Nov 12, 2013 9:02 pm
by festy
Here's a quick and dodgy perl script that will produce a bin directly from that text file:

Code: Select all

#!/usr/bin/perl
use strict;
open IN, "dump.txt" or die "$?";
open OUT, ">dump.bin" or die "$?";
while (<IN>)
        {
        chomp;
        my @line = split/\(/,$_;
        print OUT chr(hex(substr($line[1],0,2))) . chr(hex(substr($line[2],0,2)));
        }

Re: LSB & MSB in text join

Posted: Tue Nov 12, 2013 9:06 pm
by VX L67 Getrag
LMAO cool thanks again so much...

REALLY NEED TO GET MY PERL SCRIPTING UP TO DATE AS I KNOW YOU FIXED SOMETHING FOR ME LAST TIME WITH IT!!!!

& I'm so lazy I got the program & everything running but couldn't figure out how to do it & gave up interest!


Thanks again!!!