how to concat two strings with data from external file inbetween?
4 views (last 30 days)
I have two strings:
I also have an external text file, called numbers.txt whose content is:
I would like to read numbers.txt and write the following to an external file, called concat.txt
How can I do this in MATLAB?
I thank you in advance,
More Answers (1)
Paul on 5 Sep 2021
One approach, I'm sure there are others:
first = "Simpson";
last = "Wilder";
nums = string(readmatrix('input.txt'));
out = first + "," + nums + "," + last;