Greetings! |
Re: Script for extract strings from Object text separated by tab I have a module with contents imported from Word. In that way that normal text format is defined as "object text" and every Title style is associated to a given level heading. In that way each object is provided with an object heading or an object text (but not both at the same time). Objects with object heading doesn't require any further action. However for objects provided with object text, I have to extract from object text some atributes separated by tabs. For example a typical object text could be: NNNN TEXT/TABLE/OLE OBJECT (XXXXXX) (YYYYYY) After apply the script it should be converted as: Attribute 1: NNNN Object Text: TEXT/TABLE/OLE OBJECT Attribute 2: XXXXXX Attribute 3: YYYYYY I hope I can explain it clearly, because my before message was too short. I have started with the following given script and I'm trying to modify it to get above described function but I don't know how can I do it: Object o = current //bool get_text(Object o) {return o."Object Heading" "" != ""} string get_text(Object o) { if (o."Object Heading" "" != "") return "Object Heading" else return "Object Text" } Regexp r_id = regexp "(http://0-9a-z/.+) " for o in current Module do { string texto = o.(get_text(o)) if (r_id text) {o."Attribute 1" = textomatch 1 string input = richTextWithOle(o.(get_text(o))) string output = cutRichText(input, 0, length(textmatch 1)) o.(get_text(o)) = richText(output) } } |