Hi everybody, I am making effort to solve this Problem with Matlab : I have a text (txt-file or a String) describing pats of a car with different parts like this: !type wheel,battery,glass,motor !part wheel-w1 !price 50 !weight 23 !number 2 !end part wheel-w1 !part wheel-w2 !price 60 !weight 23 !number 2 !end part wheel-w2 !part battery-b1 !price 200 !weight 15 !number 1 !end part battery-b1 !part glass-g1 !price 300 !weight 12 !number 1 !end part glass-g1 !part glass-g2 !price 200 !weight 5 !number 4 !end part glass-g2 !part motor-m1 !price 5000 !weight 50 !number 1 !guarantee 5 !upgrade 1 !end part motor-m1
I want to collect all the specifications of every part by using the function "textscan" . But the textpart for the part "motor-m1" has two lines more than the others textparts.
You see, that the other parts do not have the lines:
!guarantee !upgrade
and we can consider these specifications are 0 for the other parts. so what should I do to receive a result like this (the blanks can be filled with number 0) :
partname price W. Nr. G. U. wheel-w1 50 23 2 wheel-w2 60 23 2 baterry-b1 200 15 1 glass-g1 300 12 1 glass-g2 200 5 4 motor-m1 5000 50 1 5 1
Thanks for your help in advance !
Best Answer