Dec-20-2019, 05:33 PM
(Dec-20-2019, 03:58 PM)ichabod801 Wrote: First you have to read the Etabs data. They appear to be in name/value pairs. So I would use split() to get the words. Loop through the words, starting with an empty name, and an empty list of name/value pairs. For each word, if you don't have a name, save it as the name. If you have a name and the word only has numbers (use isdigit() to check), append a tuple of the name and the word to the the list, and clear the name. Otherwise, keep adding to the value until you have a double quote at the end, and store that as a name/value tuple and clear the name.
Then you need to translate. You'll need a mapping of terms, like FRAMESECTION to SectionName. Loop through your stored name/value pairs, change the names and give the values with the new format, and make sure you add things like area as needed.
I have made a similar example to imitate the different arrangement and expression in those syntax files.
(a) I am ten years old
I love eating apple
I am a boy
(b) Apple is my favourite fruit
I am a male
I have birthed 10 years
I would like to convert from (a) to (b), may you show me the steps?