How to read *.inp file and replace specific lines in the file

18 ビュー (過去 30 日間)
Chen Deng
Chen Deng 2015 年 10 月 30 日
編集済み: Walter Roberson 2022 年 2 月 24 日
I have a *.inp file (Abaqus) with both characters and numbers, column # are not the same for all the lines. Just want to know how to read the file and change parts of data with my own data from another data file, and save it back to *.inp format. (Tried to open it as a cell-array file, replace some data and save it back as *.inp, but it does run on the Abaqus)
  2 件のコメント
pasupuleti naga
pasupuleti naga 2022 年 2 月 24 日
Hi, can you please help me in the same. I tried to do same but ino file is not working properly in abaqus eventhough inp file variables are changing
Walter Roberson
Walter Roberson 2022 年 2 月 24 日
編集済み: Walter Roberson 2022 年 2 月 24 日

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

回答 (1 件)

Nitin Khola
Nitin Khola 2015 年 11 月 3 日
My understanding is that you want to read a file and modify data. A workflow that I can suggest is to start with the import tool to interactively import variables (and generating a script if needed). Just ensure that "All files" is selected from the dropdown once (by default, it is "Recognized data files", the dialog to select the file opens. Refer to the following documentation for details. http://www.mathworks.com/help/matlab/ref/importtool-app.html
Once you have made changes to the variables, you can then use low level file I/O write back the data in the original format. http://www.mathworks.com/help/matlab/import_export/writing-to-text-data-files-with-low-level-io.html
I hope it helps.

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by