LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy only part of a binary file after selecting a start and stop byte?

I need to copy a selectable block of binary data from one file to a new file.  The binary file is made up of several data widths (8/16/32 signed and unsigned).  If I use a read binary function I will need to account for the data types within the file.  I was hoping to do a copy function with a start and stop byte control. Any pointers?  
0 Kudos
Message 1 of 5
(5,498 Views)


@fishindays wrote:
The binary file is made up of several data widths (8/16/32 signed and unsigned). 
Is there any pattern to the madness? How do you know what's where, before and after cutting?
0 Kudos
Message 2 of 5
(5,491 Views)
Yes, there is a method...the file (2GB) is made up of five different record types (random) with each record being 512 bytes.  Within each record there are different data types that are defined by byte location within the record.  I could use the record type to drill into the data, adjust data types, and extract and rewrite what I need, but this will take some processing time.  I was hoping for a method to select desired data with start and stop byte controls and pefrom a copy.  For now I am going to set up to use a drill down method and do some test.
0 Kudos
Message 3 of 5
(5,484 Views)
Are you reading complete records each time? Do you know the location in the file of the desired record? Does the file have a header preceeding the first record? If you know these things you should be able to calculate an offset into the file. Otherwise it may be difficult to navigate through the file. What version of LV are you using?

Lynn
0 Kudos
Message 4 of 5
(5,480 Views)

The attached Rube Goldberg Code copies two arrays of clusters to two arrays of indicators. Smiley Surprised

Ben

BTW: It does so by writtng the flattened data to a fixed length file and decoding same on the read. Smiley Happy

Message Edited by Ben on 03-24-2007 12:54 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
0 Kudos
Message 5 of 5
(5,459 Views)