How to change a specific column to a .txt file by importing another txt file?

1 次查看(过去 30 天)
Hello,
I have a question about a code. I have two .txt files (I am importing them in order to understand what the format is). Document1.txt has rows and columns of numbers, and "Document2.txt" has only one column with numbers. I would like to change the content of Document1.txt and creating 4 new documents.
The change that I want is to change the numbers of 4th column of "Document1.txt" (I mean the number "70") by the number of first row of column of "Document2.txt" (I mean number "30"). After this change , I would like to create a new .txt file with this change. (Let's call it "Document1_revised.txt"). After goinr to the second row of column of "Document2.txt" and doing the replacement etc..
To sum up I would like via a loop to create txt files by replacing specific thing from one file, and importing data from another file. I am importing the 4 .txt files that I would to create via commands in matlab.
Could anyone help me?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Files and Folders 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by