printing in a loop

so I have a file customers.txt with names in the order of first to last such as
jones, juanita
ant, adam
and I need to reverse them and store into a variable custformat in the order of
juanita jones
adam ant
this is what i have so far
fid=fopen('customers.txt');
while feof(fid)==0
c=fgetl(fid);
[f b]=strtok(c,',');;
l=[b(3:end) ' '];
cusformat=[l f]
end

3 件のコメント

Bob Thompson
Bob Thompson 2019 年 3 月 13 日
What exactly is your question?
Walter Roberson
Walter Roberson 2019 年 3 月 13 日
Before the loop:
cusformat = {};
Inside the loop:
cusformat{end+1} = [l f];
bsta
bsta 2019 年 3 月 13 日
Thank you

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

回答 (0 件)

カテゴリ

製品

リリース

R2017a

タグ

質問済み:

2019 年 3 月 13 日

コメント済み:

2019 年 3 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by