Relimiter for text files

版本 1.0.0.0 (3.8 KB) 作者: Michael Weidman
A utility for robustly changing the delimiter within text files in order to make them easier to use
209.0 次下载
更新时间 2015/1/20

查看许可证

This utility intelligently provides a new delimiter to a file while ignoring any instances of the delimiter that occur between double quotes (or other qualifiers).
It's often the case that a comma-delimited file will use commas both as delimiters and within text cells. In the latter case, the cell is usually surrounded by double quotes ("like this") or some other qualifier to indicate that the comma within is to be ignored as a delimiter.

MATLAB does not pay attention to this in functions like READTABLE and DATASET, to the annoyance of the end user.

This function provides one solution: it creates a temporary file that is delimited with a different delimiter (by default, '|') but otherwise identical. It correctly ignores the space between qualifiers. This can be called before READTABLE or DATASET, and the downstream code base is thus unaffected.

Optional arguments allow you to control the output file location, the new and old delimiters, and the text qualifier character. Attention has been paid to execution speed, but further suggestions for speedups are welcome.

引用格式

Michael Weidman (2024). Relimiter for text files (https://www.mathworks.com/matlabcentral/fileexchange/49096-relimiter-for-text-files), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2013a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Dates and Time 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0