Hi everyone!
I would like to ask if anyone knows what is the structure of a .dta datafile's binary header?
My problem is that I would like to save a datafile so big, that I don't have enough memory to save it.
Now, if I split the datafile into two sections, I have enough memory to perform operations and save those sections.
But then again, I will run out of memory if I append the second section to the first and attempt to save the whole datafile.
In order to solve this, it occured to me, that I could remove the binary header of the second section.
Then I could just tell bash or command prompt to put the two files together, as in:
This way the whole file would not have to be loaded into memory.
But to achieve this, I would need to know where the header ends.
Let's assume both files have matching number of variables, variable names and variable types.
I wonder will the observation numbers cause a conflict and can I make the second file to start observations' numbers where the first datafile ends?
After looking at a .dta file with a text editor, I'm assuming the data part starts at a point where I see the tag <data> .
Finally, since the structure looks a bit like html, I'm also thinking should I remove the closing </> parts from the first section file, so that the resulting file would have its header start at first_section.dta and end at second_section.dta, if that makes any sense?
I welcome any ideas or better approaches!
Best regards,
Kasper
I would like to ask if anyone knows what is the structure of a .dta datafile's binary header?
My problem is that I would like to save a datafile so big, that I don't have enough memory to save it.
Now, if I split the datafile into two sections, I have enough memory to perform operations and save those sections.
But then again, I will run out of memory if I append the second section to the first and attempt to save the whole datafile.
In order to solve this, it occured to me, that I could remove the binary header of the second section.
Then I could just tell bash or command prompt to put the two files together, as in:
Code:
cat first_section.dta second_section.dta > whole_datafile.dta
But to achieve this, I would need to know where the header ends.
Let's assume both files have matching number of variables, variable names and variable types.
I wonder will the observation numbers cause a conflict and can I make the second file to start observations' numbers where the first datafile ends?
After looking at a .dta file with a text editor, I'm assuming the data part starts at a point where I see the tag <data> .
Finally, since the structure looks a bit like html, I'm also thinking should I remove the closing </> parts from the first section file, so that the resulting file would have its header start at first_section.dta and end at second_section.dta, if that makes any sense?
I welcome any ideas or better approaches!
Best regards,
Kasper

Comment