title: How to read a file of extension .dat in python and extract data from it
body: <p><a href="https://i.stack.imgur.com/Qa5sB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qa5sB.png" alt="i want the values from 01 10 60 upto 7f 00 00 and after that i want from 02 10 60 and so on.."></a><a href="https://i.stack.imgur.com/s8UVP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s8UVP.png" alt="The hex values at the center i want only those i dont want the left and right side values"></a>Hello everyone!
  I am currently working on a project and i need to automate the things on it using file handling..there is a file in '.dat' format and i want to extract the data from it..the data present in that is in the form of hex..and by getting these hex values i need to perform serial port communication..i can access this dat file from a tool named hex editor and can see the values from it..but the problem is that i do not want the complete data from that file i need to extract it in segments..i tried to read it but it reads it completely and i got some garbage values also in the output..</p>
  
  <p>i will try to upload a screenshot of the hex editor and the values which i want to extract from it..so please antbody help me out in this</p>