c# : Loading typed data from file without casting -
is there way avoid casting non-string type when reading data text file containing exclusively integer values separated integer markers ('0000' example) ?
(real-life example : genetic dna sequences, each dna marker being digit sequence.)
edit : sample data : 581684531650000651651561156843000021484865321200001987984948978465156115684300002148486532120000198798400009489786515611568430000214848653212000019879849480006516515611684531650000651651561156843000021 etc...
unless use binary writer , read bytes, rather text (because how data written @ first),
i think funky idea, "no" straight answer this.
wanted definitive confirmation here, sure.
i welcome intermediate solution write/read kind of data efficiently without having code custom reader gui display outside app, intelligibly (in generic reader/viewer).
rather casting, should use .tryparse(...)
method(s) of types trying read. more type-safe solution.
and answer question, other using binary file, there not (to knowledge) way without casting (or using tryparse methods)
Comments
Post a Comment