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

1 view (last 30 days)
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?

Answers (0)

Categories

Find more on Files and Folders in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!