-1

I have a group of .dat files I need to convert to .txt files. I have a directory called "data" that has "210" files (0.dat, 1.dat, ......210.dat), I want to convert these .dat files to .txt files (0.txt, 1.txt ......210.txt), the data type is 16bit integer.

1 Answers1

0

Ideally you are supposed to try a few steps before coming here asking for a solution. Since this is your first post, I'll give you a few pointers. Next time please Google a few solutions. Try them. Post your code/error if you have any issues to receive help.

From the directory, Load all the contents of the folder using,

files = dir('*.dat');

Add a FOR loop to read each dat file one by one.

fileID = fopen('XXXX.dat'); 
OneByte = fread(fileID,'*uint16');

Then once the file is loaded you can convert it into .txt file.

whoknowsmerida
  • 134
  • 2
  • 10