0

My senior/friend asked me to do a tool that would simply check a SRecord file (.mot file) if it contains strings typed in by the user of the tool.
I was thinking if this solution would work when dealing with srecord files.
Before this, I just googled on how to read a file and got this as the number one hit. But I'm not sure if these links can be useful with what I'm supposed to do.

The strings would depend on the user as it doesn't have a clear format but from what I've been told, the address and the data of the record would be typed in and the program would check if the input exists in the .mot file

Will the links provided above work on reading the SRecord files? When I tried a file analysis tool, the .mot files is said to be of Text file type to maybe the solutions in the links are applicable?

Community
  • 1
  • 1
Kurisuchin
  • 155
  • 1
  • 4
  • 20
  • What is your question/problem? – take May 07 '15 at 08:48
  • Yeah, I just realized I forget to put the question. Edited. – Kurisuchin May 07 '15 at 08:49
  • 1
    I don't know `SRecord`-files. But according to [wikipedia](http://en.wikipedia.org/wiki/SREC_(file_format)) it stores binary informations in a text file. So are you looking for "text" like `E5398000`, then yes, otherwise no. – Tim Schmelter May 07 '15 at 09:02

1 Answers1

0

I don't know how a SRecord file looks like, but if its an Textfile and you are looking for some string occurencies you have already found some usefull references.

File.ReadAllText("C:\file.mot").Contains("someuserinput");

will give you a boolean if your search input is in the file or not.

take
  • 2,202
  • 2
  • 19
  • 36