python - how to point specific location in a file? -
my file contains tables , other datas, after opening file file handle. want point specific location? example, when find word "pin value" should point there. how point specific location in file?
https://stackoverflow.com/a/4999741/248140 shows how can have random (non-sequential) access file. note still have work out where in file "pin value" located, meaning you'd have have sort of index @ start of file, , you're getting dangerously "i should use proper file format this" territory.
if it's you'll want have contents of file in memory @ once, consider reading file @ start of program , converting whatever internal representation suits best.
Comments
Post a Comment