Text File Read: 64 bit data set - MATLAB Cody - MATLAB Central

Problem 1731. Text File Read: 64 bit data set

Difficulty:Rate
This Challenge is to read a text file that has vary large integers up to 2e18, typical for Google Code Jam. These values are well within the bounds of uint64.
The data is an array of Q pairs.
Input: [Q, fname] The number of lines in the file and its filename.
Output: M a uint64 matrix of size(Q,2)
Example:
Input: {4, 'Cody_64.txt']
The text file:
308436464205151562 1850618785230909388
373665302816212423 1494661211264849698
760961177192651897 1521922354385303795
1 2000000000000000000
Ouput: A uint64 (4,2) matrix to full precision.
Note of Warning:
The fscanf function with %ul may not succeed, as of 7/20/2013.
The result window has a case showing the function output
Related Challenges:
1) Bullseye Large Numbers r<1E18, P<2E18
2) Super Large Numbers >2^64 (Java BigInteger methods)

Solution Stats

21.51% Correct | 78.49% Incorrect
Last Solution submitted on Mar 28, 2023

Problem Comments

Solution Comments

Show comments
Join Cody Contest 2025 — Have Fun and Win Prizes!
...
We’re excited to invite you to Cody Contest 2025! 🎉 Pick a team,...
🚀 MATLAB EXPO 2025 – Day 2 Starts Tomorrow, November 13!
Don’t miss out on two incredible keynotes that will shape the future...
0

Problem Recent Solvers13

Suggested Problems

More from this Author308

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!