is a string matlab to me that looks like this:
str = Z 1 -355.66338432 1 Z 2 1.3833 9 828 412 Z3 9.00000000 412 Z 4 -10.27835665 312 22 - 1 Z 5 3.00000000 612 2 2 Z 6 6,532 9 554 612 2 2 J 7 7 5.00000000 812 33 - 2 Z 8 0.19040409 812 33 - 2 Z 9 2.00000000 812 3 3 Z 10 -1.00534284 812 3 3 Z 11 7.27727717 512 64 - 62 1 I think the number I want to remove in the third column, but may not know the correct use Regexp.
I have MATLAB does not work, so I can not give you the code, but usually at a time Run a line through the string, and use regex to:
^ \ s * z \ s * \ d + \ s * (-? \ D + \. \ D +) . * $ This will capture the number as the first capture group, \ 1 . Spreads as RegEx is: ^ beginning of line * Z \ s * The first column - white space, literally `Z`, white space \ d + \ s * A second column - integer Number, white space (-? \ D + \. \ D +) Third column - one (potential negative) decimal number. * Anything end of line $ refer to it
Alternatively, use the tool that is actually for this job:. (.)
Comments
Post a Comment