What is the correct Regex syntax to find an "empty string" (i.e. empty field) in Multiterm?

Former Member
Former Member
  1. I have added a new field ('Source') to one of my Termbases by editing the definition (within Multiterm). I've been trying to no avail to populate this new field with the same value across the whole Termbase. I believe it should be very simple to replace an empty field with some content using search and replace, but I wish someone give me a hand here.
  2. For this, I went to "Batch edit Script" and tried, many times, different forms of syntax for the Regex pattern. The only syntax that seems to be working is ^(.*)$ although I tried ^(s*)$ as well.
  3. BUT since I had four entries already edited manually, the script went through the whole Termbase and at the end it said "4 entries edited". Then I realized that the script did nothing.
  4. Next thing I did was to delete the manual entries, thinking that my newly created field had to be completely empty throughout, but the script did nothing at all again.

In other words, I have accomplished nothing after spending an inordinate amount of time. Any help is really appreciated. Thanks.

Parents
  • Do you want to have exactly the same value in this field?
    If so, export the TB to XML using the default export definition. Save the termbase definition (XDT).
    Open the exported XML, locate the tag pair for the corresponding field, copy those, enter them into the search field, then put them separated by the desired value in the replace field. Replace all occurrences. Save the XML under new name. Create a new TB with the XDT and import this modified XML. This way all entries should have the desired field with the desired value.

    _________________________________________________________

    When asking for help here, please be as accurate as possible. Please always remember to give the exact version of product used and all possible error messages received. The better you describe your problem, the better help you will get.

    Want to learn more about Trados Studio? Visit the Community Hub. Have a good idea to make Trados Studio better? Publish it here.

  • BTW, an "empty" string should be just ^$ - assuming the position at the beginning of the string, finding nothing and assuming the position at the end of the string. In your regex ^(.*)$ the brackets are superfluous. Regarding to Regex Buddy all proposals (mine and yours) may find zero length matches. The regex ^(s*)$ finds JUST the "s" literally, so I think you meant \s - and this regex matches then also zero length strings.

    _________________________________________________________

    When asking for help here, please be as accurate as possible. Please always remember to give the exact version of product used and all possible error messages received. The better you describe your problem, the better help you will get.

    Want to learn more about Trados Studio? Visit the Community Hub. Have a good idea to make Trados Studio better? Publish it here.

  • Former Member
    0 Former Member in reply to Jerzy Czopik
    Jerzy, thanks for the tip, using the XDT. However, I'm trying to avoid exporting, importing, converting, etc. I hope the SDL team provides some Multiterm batch edit scripts (*.sldmt.batchedit), among them, one that uses regular expressions. The regex patterns you suggested did not work either. Cheers!
  • Hello Ozzie,

    I can confirm that it's not possible to do this with the Batch Edit as the whole routine is based around actually finding something to replace. I have escalated for discussion, so you might want to log an idea for this in the meantime (if you haven't already):

    community.sdl.com/.../

    The best solution I think, would be to use the Glossary Converter as it would be a simple one operation to get the spreadsheet, then copy the value you want into the new field (also trivial), and finally one operation to convert back to your termbase. I think this would work for anything but the most complex of termbases. So if you had URL values in the fields anywhere then this would not work and you'd need to use MultiTerm Convert in the process for the upgrade.

    Regards

    Paul

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

Reply
  • Hello Ozzie,

    I can confirm that it's not possible to do this with the Batch Edit as the whole routine is based around actually finding something to replace. I have escalated for discussion, so you might want to log an idea for this in the meantime (if you haven't already):

    community.sdl.com/.../

    The best solution I think, would be to use the Glossary Converter as it would be a simple one operation to get the spreadsheet, then copy the value you want into the new field (also trivial), and finally one operation to convert back to your termbase. I think this would work for anything but the most complex of termbases. So if you had URL values in the fields anywhere then this would not work and you'd need to use MultiTerm Convert in the process for the upgrade.

    Regards

    Paul

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

Children