15,881,381 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 13967442 (Top 9 by date)
Member 13967442
1-Sep-18 5:19am
View
one header, contains info about # records that needs to be unpacked for that particular packet. and so the info in each header is different. e.g one packet can have 2 records or the next packet could be 5...according to the read in each $header['L# of Records'];
Member 13967442
31-Aug-18 15:16pm
View
what I am saying is, the above solution only works for the first packet,
$numRecords = $header['L# of Records']; // the value in the $numRecords is the number of records in the first first packet. how do I loop to get $numRecords in the header file of each packet.
Member 13967442
31-Aug-18 13:12pm
View
what about reading the next packet header?
Member 13967442
31-Aug-18 12:35pm
View
$header = unpack ($header_format, $data);
$numRecords = $header['L# of Records'];
for ($i = 0; i < $numRecords; $i++)
{
$record = unpack ($record_format, $data, $i);
}
I believe the above code might unpack the first packet, how do I do it for next packet until to the end of file
Member 13967442
31-Aug-18 11:39am
View
the record has a size of 30 and the header 18 in size, that is how i counted it
Member 13967442
31-Aug-18 11:15am
View
sorry that is a mistake
Member 13967442
31-Aug-18 10:26am
View
The file is not a .dbf file, it is a .bin file with each packet having header size 18. and 'CTime/' is wrong 'dTime', since it is timestamp
Member 13967442
31-Aug-18 0:36am
View
Deleted
Every packet has a header file, every header file should be unpacked first to get 'L# of Records/' , then I know how many records needs to be unpacked the rest of file. I have used the for loop, since every header should have
'Cid/'. 'Cnumber/' . 'CIdentifier/' . ....similar but my output is not having that.
for ($offset = 0; $offset < strlen ($data); $offset += 32) {
$unpackeddata= unpack ("@$offset/$header_format", $data);
print "
"; print_r ($unpackeddata);print "
";}
Member 13967442
30-Aug-18 13:59pm
View
I tried to explain a bit,added more code
Show More