title: Octave - Adding '\n' to String Array is Not Creating a New Line
body: <p>I want to change <code>','</code> character to <code>'\n'</code> and save it to the text file</p>
  <p>All files are in this format:</p>
  <pre><code>546,234,453,685,.....,234
  </code></pre>
  <p>I want to make it like:</p>
  <pre><code>546
  
  234
  
  453
  
  685
  
  ...
  
  234
  </code></pre>
  <p>My initiation to this problem is like this:</p>
  <pre><code>fid=fopen(files{i});
  strArr=fscanf(fid,'%s');
  
  newstrArr=strrep(strArr,',','\n');
  
  % Take each .txt input
  for j=1:length(newstrArr)  
     Array=[Array newstrArr(j)];   
  endfor
  </code></pre>
  <p>Let me explain step by step:</p>
  <p>1st I open the current text file</p>
  <pre><code> fid=fopen(files{i});
  </code></pre>
  <p>2nd I find the strings in text file</p>
  <pre><code>strArr=fscanf(fid,'%s');
  </code></pre>
  <p>Please Note that you can't replace %s with %d. (Correct me if I am wrong)</p>
  <p>3rd I replace commas with newline character</p>
  <pre><code>newstrArr=strrep(strArr,',','\n');
  </code></pre>
  <p>4th I add each character to a new array with for loop</p>
  <pre><code>for j=1:length(newstrArr)  
     Array=[Array newstrArr(j)];   
  endfor
  </code></pre>
  <p>However When I display, using;</p>
  <pre><code>disp(Array);
  </code></pre>
  <p>I have this <a href="https://i.stack.imgur.com/PSM5K.jpg" rel="nofollow noreferrer">output</a></p>
  <p>How can I properly replace the commas with newlines?</p>
  <p>Regards</p>