Can writetable delimit strings using single-quotes?
조회 수: 4(최근 30일)
표시 이전 댓글
I am using writetable to export to CSV. All strings are delimited with double quotes. Is there any way to have strings delimited by single quotes? The help from "doc writetable" doesn't seem to provide a name-value pair to control this.
댓글 수: 0
Chunru 2022년 4월 26일
You may not change the quote string with writetable directly.
However, you can add a single quote to your string before writing.
% create a small table
str = ["A", "B", "C D"]';
num = [1 2 3]';
t = table(str, num)
% No quotation marks
% double quotation marks
writetable(t, 'test1.txt', 'QuoteStrings', true)
% single quotation marks
t.str = "'"+t.str+"'";
댓글 수: 1
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!