Page 1 of 1

Editing .sto file in Excel

Posted: Thu Mar 02, 2023 8:27 pm
by zakiahussain
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.

Re: Editing .sto file in Excel

Posted: Fri Mar 03, 2023 8:04 am
by openseb
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

Re: Editing .sto file in Excel

Posted: Fri Mar 03, 2023 6:40 pm
by zakiahussain
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.

Re: Editing .sto file in Excel

Posted: Sun Mar 05, 2023 5:56 pm
by zakiahussain
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.

Re: Editing .sto file in Excel

Posted: Tue Mar 14, 2023 8:22 am
by gtuer51
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.

Re: Editing .sto file in Excel

Posted: Tue Mar 14, 2023 8:40 am
by zakiahussain
Hi Garrett

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

Will try pandas lib for manipulating .sto files.