# \[✓\] Open a Bin file

**URL:** <https://community.wolfram.com/t/open-a-bin-file/15684>\
**Category:** Questions\
**Tags:** external-interfaces, import-and-export, numerical-computation\
**Created:** [April 6, 2020, 5:45pm UTC](https://community.wolfram.com/t/open-a-bin-file/15684 "2020-04-06T17:45:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunovusini](https://avatars.discourse-cdn.com/v4/letter/b/a9a28c/32.png) [@brunovusini](https://community.wolfram.com/u/brunovusini)\
**Post date:** [April 6, 2020, 5:45pm UTC](https://community.wolfram.com/t/open-a-bin-file/15684/1 "2020-04-06T17:45:05Z")

</div>

Dear All,  
I am new to Mathematica. I just downloaded the trial version just to understand if it can be good for me.  
I normally work around numerical data and i need to read and work with a BIN file.  
The code that I use in Octave to open the file is:

> fid=fopen(filename);
> 
> A=fread(fid,‘uint16’);
> 
> fclose(fid);

How can I open this file in Mathematica?  
Thank you very much and best regards.

Burno

---

<div class="post-metadata">

**Author:** ![rohitnamjoshi](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitnamjoshi](https://community.wolfram.com/u/rohitnamjoshi)\
**Post date:** [April 6, 2020, 5:52pm UTC](https://community.wolfram.com/t/open-a-bin-file/15684/2 "2020-04-06T17:52:24Z")

</div>

Hi Bruno,

You can try [`BinaryReadList`](http://reference.wolfram.com/language/ref/BinaryReadList.html)

```
data = BinaryReadList[filename, "UnsignedInteger16"];
Close[filename];

```

---

<div class="post-metadata">

**Author:** ![brunovusini](https://avatars.discourse-cdn.com/v4/letter/b/a9a28c/32.png) [@brunovusini](https://community.wolfram.com/u/brunovusini)\
**Post date:** [April 7, 2020, 7:27am UTC](https://community.wolfram.com/t/open-a-bin-file/15684/3 "2020-04-07T07:27:30Z")

</div>

Hi Rohit.  
Thank you very much for your reply!  
I tried and it works!
