Hi there, shameful Linux Newbie here
I was wondering if you could help with my problem...
I have plenty of files I'd like to concatenate. I know how to basically use cat command but that won't be enough from what I need : excluding the last xx bytes from files before assembling since there's some redundancy
the interesting part is the xx bytes to remove is determined by the filename themselves, ie
file 1 is named something like 0-54548
file 2 is named something like 54475-648459
file 3 is named 648345-1269494
etc
so for file 1 I would have to drop bytes between 54475 till the end before joining file 2. etc
it would be easier if it was always the exact same bytes value to remove , alas there are some variations, so it must be calculated from filenames.
I feel like it's possible to script something with not much lines within a loop, but my unix knowledge is way too rudimentary for now ^^
I also read about dd command which could probably be of some help to generate the files without the unwanted part, now I'm a bit clueless about extracting character chains from filenames, turning into numeric values, doing the maths and use this dd or whatever else command so I can assemble the resulting files...