Unsolved Splitting a bin file of 10560 bytes
-
@jsulm
I previously answered this question asked by @Anna_64 in other thread at https://forum.qt.io/topic/100441/issue-reading-from-qserialport/14. -
@jsulm how to read a file in 64 times in qt
-
@Anna_64 Using a for-loop and QFile::read(int) as @Christian-Ehrlicher suggested.
-
@jsulm i have a QByte Array z=y.mid(0,16326);
i want to 64 chunk like this from 16326 how to do that -
@Anna_64
you're either having us on, or you started coding literally last week.In the later case, you should to some tutorial/learning on the basics first.
-
@Anna_64 said in Splitting a bin file of 10560 bytes:
i want to 64 chunk like this from 16326 how to do that
So, you want to divide 16326 into 64 chunks, right?
What would the size of one chink be then? This is now not programming, just simple math.
If you calculated the size of one chunk, you then can have a for-loop (https://en.cppreference.com/w/cpp/language/for) which you execute 64 times and in each iteration read one chunk from the file (using QFile::read(int)). -
yes i calculated size of a chunk it s 16416 now i take it like QByteArray y= iContents.mid(0,16416)
now i need 64 chunk like this
thank u for guiding -
for (int i = 0; i < 64; ++i) { QByteArray y= iContents.mid(i * 16416, 16416); ... }
-
@jsulmthank you
-
@Anna_64 if your issue is solved please don't forget to mark your post as such!. Thanks.