Writing table variables with quotations marks ("Placeholder variable name")

14 ビュー (過去 30 日間)
Aske Ejdrup
Aske Ejdrup 2019 年 8 月 15 日
編集済み: Aske Ejdrup 2019 年 8 月 15 日
Hi.
When loading, manipulating and subsequently writing a table (readtable, writetable) my column/variable names are saved to .csv files with no quotation marks surround them.
E.g.:
Reading variable names like: ["id","frame","x","y","sigma","intensity"]
and subsequently saving them as: [id,frame,x,y,sigma,intensity]
This causes issue with my further use of the tables. I could manually edit, but would prefer to be able to bulk process.
Cheers.

回答 (1 件)

Stephen23
Stephen23 2019 年 8 月 15 日
編集済み: Stephen23 2019 年 8 月 15 日
'QuoteStrings',true
Otherwise it is likely not difficult to write your own file using fprintf.
  1 件のコメント
Aske Ejdrup
Aske Ejdrup 2019 年 8 月 15 日
編集済み: Aske Ejdrup 2019 年 8 月 15 日
'QuoteStrings',true
That only seems works for cells of the table, not the variable names themselves.
I'm not familiar with writing to .txt or .csv with fprintf but will give it a shot if no "quick fix" is possible.
Thanks

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeWhos についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by