Editing .sto file in Excel

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Zakia Hussain
Posts: 37
Joined: Sun Dec 26, 2021 10:44 pm

Editing .sto file in Excel

Post by Zakia Hussain » Thu Mar 02, 2023 8:27 pm

Hi everyone


I am analyzing sit-to-walk motion using 3 force plates. To consider grf at all three force plates, I do Inverse Dynamics three times (three separate ID setup files indicating the different time ranges referring to instants when feet are at different FPs) with 3 separate externalload.xml files. Then after ID analysis, i combine all three into one .sto file in EXCEL.

All works well in OpenSim, however, in CEINMS it throws an error with this edited id.sto file which is strange (error image included). If I use unedited .sto file it works but with this edited sto file it doesnt.

Not sure if I should be posting it here or CEINMS forum. But in general i want to know is it recommended to edit .sto file in Excel?


Thank you

Any help would be much appreciated.
Attachments
ERROR.png
ERROR.png (38.9 KiB) Viewed 329 times

Tags:

User avatar
Sebastian Neuberg
Posts: 15
Joined: Mon Mar 08, 2021 3:21 pm

Re: Editing .sto file in Excel

Post by Sebastian Neuberg » Fri Mar 03, 2023 8:04 am

Hi Zakia,

Two suggestions which might solve the issue:
1. If dot is not the system standard as decimal separator of your operating system.
In Excel, go to File > Options > Advanced > uncheck "Use system separators" and enter . as decimal separator and , as thousands separator.

2. Use tab delimited separation when exporting the edited file.
In Excel, go to File > Export > Change File Type > Text (Tab delimited) (*.txt) > Name and Save the file > rename the file extension .txt to .sto in your file browser

User avatar
Zakia Hussain
Posts: 37
Joined: Sun Dec 26, 2021 10:44 pm

Re: Editing .sto file in Excel

Post by Zakia Hussain » Fri Mar 03, 2023 6:40 pm

Hi Sebastian

Thanks for responding.

I tried both of your suggestions but unfortunately, none seemed to work :cry:

I observed the size of the .sto file gets reduced even if i undo my edit. So once edited, the file doesn't remain the same even if you undo all changes you had made.

Any more suggestions.

Thanks again.

User avatar
Zakia Hussain
Posts: 37
Joined: Sun Dec 26, 2021 10:44 pm

Re: Editing .sto file in Excel

Post by Zakia Hussain » Sun Mar 05, 2023 5:56 pm

Just for the information of anyone who has a similar query.

Editing .sto/.mot files in Notepad++ instead of Excel, fixed this issue for me.

User avatar
Garrett Tuer
Posts: 5
Joined: Tue Jul 20, 2021 8:38 am

Re: Editing .sto file in Excel

Post by Garrett Tuer » Tue Mar 14, 2023 8:22 am

Hi Zakia,

I'm glad you found the solution I was going to suggest!
From what I can tell, the issue is that Excel automatically adds tabs to the header lines of the .sto/.mot files such that the length of those lines matches the number of columns in the data. These extra tabs seem to cause issues with some parsers (something to keep in mind for files outside of OpenSim as well).

I generally try to make any edits to .sto/.mot files in Notepad++ because of this. There are times, though, when I want to use the mathematical functionality and column/row manipulation of Excel. In these cases, I make my changes in Excel, save and close the file, then open the newly edited file in Notepad++ to remove the excess tabs in the header lines. Doing this seems to avoid any issues caused by the additional tabs added by Excel. Alternatively, if you are comfortable with the pandas library in Python, that can be another convenient way to read, manipulate, and save .sto/.mot files for more complex operations.

User avatar
Zakia Hussain
Posts: 37
Joined: Sun Dec 26, 2021 10:44 pm

Re: Editing .sto file in Excel

Post by Zakia Hussain » Tue Mar 14, 2023 8:40 am

Hi Garrett

Thanks a lot, now I know why i Excel edited files didnt work.

Will try pandas lib for manipulating .sto files.

POST REPLY