Use character 'dot' within file names using sprintf

How to use 'dot' within a filename in the function sprintf so that the characters coming after the dot does not get mistaken for the file extension

3 件のコメント

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 7 月 31 日
Mistaken for what? how are you using this file name?
Michael Haderlein
Michael Haderlein 2014 年 7 月 31 日
Please don't open multiple threads for the basically same question:
I suppose the answer for the question here is in the other thread my comment on my answer.
YADHUKRISHNAN
YADHUKRISHNAN 2014 年 7 月 31 日
Thankyou for your valuable replies

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

回答 (1 件)

dpb
dpb 2014 年 7 月 31 日

1 投票

No can do...the OS interprets the name according to its rules -- and the rule in common OS of the day is that the dot signifies the end of the name and the beginning of an extension (altho there may be more than one in some OS and can use more than one in Windoes it tends to confuse it)...

3 件のコメント

YADHUKRISHNAN
YADHUKRISHNAN 2014 年 7 月 31 日
Is float to string or something like that worth a try?
dpb
dpb 2014 年 7 月 31 日
編集済み: dpb 2014 年 7 月 31 日
One can always build the name with multiple dots but the OS and apps will treat it as they do. There's no magic elixir to tell it (the OS/app) that "oh, this dot doesn't count" in starting the filename parsing.
Best idea I'd have is to substitute underscore or dash or other character in place of the dot that isn't intended to be the extension separator character. Alternatively, make the field fixed-width and interpret by position--makes visual scanning a little more difficult but if use zero-fill instead of none alphabetization will work more better as payback...
YADHUKRISHNAN
YADHUKRISHNAN 2014 年 7 月 31 日

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

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

質問済み:

2014 年 7 月 31 日

コメント済み:

2014 年 7 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by