dat2xls
This program reads a (text data file) consisting of headers, column titles and column data (see attached data.txt). Then it opens or creates existing excel file and saves data into specified sheetname.
NOTE: The program will automatically identify the number of headerlines, columns and the column names using what so called "common sense"!
dat2xls(datfile,xlsfile,sheetname)
dat2xls(datfile,xlsfile)
datfile: Name of data file.
xlsfile: Name of excel file.
sheetname: sheet name (optional, default is 'Sheet1') if specified, a sheet with the specified name must be existing.
Example:
datfile = 'data.txt';
xlsfile = 'data.xls';
sheetname = 'Sheet2';
dat2xls(datfile,xlsfile,sheetname)
%dat2xls(datfile,xlsfile) % Will write to 'Sheet1'
Cite As
Fahad Al Mahmood (2024). dat2xls (https://www.mathworks.com/matlabcentral/fileexchange/4517-dat2xls), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Data Import and Analysis > Data Import and Export > Standard File Formats > Spreadsheets >
- MATLAB > External Language Interfaces > COM with MATLAB > Use COM Objects in MATLAB >
Tags
Acknowledgements
Inspired by: xlswrite - legacy
Inspired: Example of how to save or read data to an Excel archive.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 | Attached (data.txt) |