VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Can anyone tell me how do I add a multiple replace with a list like this?
    https://i.imgur.com/XVKuQWf.jpg
    I can't seem to find a way to import this list in Subtitle Edit.
    I would want with a simple click to replace a1 with b1, a2 with b2 etc.
    Quote Quote  
  2. Member
    Join Date
    Jul 2011
    Location
    Denmark
    Search Comp PM
    Xml files in this format can be imported:
    Code:
    <?xml version="1.0"?>
    <Settings>
      <MultipleSearchAndReplaceList>
        <Group>
          <Name>Default</Name>
          <MultipleSearchAndReplaceItem>
            <Enabled>True</Enabled>
            <FindWhat>([a-z]in)'([$ \r\n\.\,!\?\)]+)</FindWhat>
            <ReplaceWith>$1g$2</ReplaceWith>
            <SearchType>RegularExpression</SearchType>
            <Description />
          </MultipleSearchAndReplaceItem>
          <MultipleSearchAndReplaceItem>
            <Enabled>True</Enabled>
            <FindWhat>hallo</FindWhat>
            <ReplaceWith>bye</ReplaceWith>
            <SearchType>CaseSensitive</SearchType>
            <Description />
          </MultipleSearchAndReplaceItem>
        </Group>
      </MultipleSearchAndReplaceList>
    </Settings>
    But it's probably better to use a more generic replace expression via a regular expression, like:
    - Find: ([a-z]in)'([$ \r\n\.\,!\?\)]+)
    - Replace: $1g$2
    Click image for larger version

Name:	SE-multiple-replace.png
Views:	176
Size:	8.2 KB
ID:	52200
    Quote Quote  
  3. Originally Posted by Nikse View Post
    Xml files in this format can be imported:
    Code:
    <?xml version="1.0"?>
    <Settings>
      <MultipleSearchAndReplaceList>
        <Group>
          <Name>Default</Name>
          <MultipleSearchAndReplaceItem>
            <Enabled>True</Enabled>
            <FindWhat>([a-z]in)'([$ \r\n\.\,!\?\)]+)</FindWhat>
            <ReplaceWith>$1g$2</ReplaceWith>
            <SearchType>RegularExpression</SearchType>
            <Description />
          </MultipleSearchAndReplaceItem>
          <MultipleSearchAndReplaceItem>
            <Enabled>True</Enabled>
            <FindWhat>hallo</FindWhat>
            <ReplaceWith>bye</ReplaceWith>
            <SearchType>CaseSensitive</SearchType>
            <Description />
          </MultipleSearchAndReplaceItem>
        </Group>
      </MultipleSearchAndReplaceList>
    </Settings>
    But it's probably better to use a more generic replace expression via a regular expression, like:
    - Find: ([a-z]in)'([$ \r\n\.\,!\?\)]+)
    - Replace: $1g$2
    Image
    [Attachment 52200 - Click to enlarge]
    Thanks a lot sir! I will go with the regular expression now.

    In order for me not to waste other people's time, and we assume regex doesn't exist, what would be the best way to replace a1 with b1, a2 with b2 etc?
    I tried importing this
    Code:
    <?xml version="1.0"?>
    <Settings>
      <MultipleSearchAndReplaceList>
        <Test>
          <Name>Test2</Name>
            <MultipleSearchAndReplaceItem>
            <Enabled>True</Enabled>
            <FindWhat>leavin'</FindWhat>
            <ReplaceWith>leaving</ReplaceWith>
            <FindWhat>meanin'</FindWhat>
            <ReplaceWith>meaning</ReplaceWith>
            <FindWhat>lettin'</FindWhat>
            <ReplaceWith>letting</ReplaceWith>
            <FindWhat>seemin'</FindWhat>
            <ReplaceWith>seeming</ReplaceWith>
            <FindWhat>talkin'</FindWhat>
            <ReplaceWith>talking</ReplaceWith>
            <FindWhat>startin'</FindWhat>
            <ReplaceWith>starting</ReplaceWith>
            <FindWhat>hearin'</FindWhat>
            <ReplaceWith>hearing</ReplaceWith>
            <FindWhat>runnin'</FindWhat>
            <ReplaceWith>running</ReplaceWith>
            <FindWhat>likin'</FindWhat>
            <ReplaceWith>liking</ReplaceWith>
            <SearchType>Normal</SearchType>
            <Description />
          </MultipleSearchAndReplaceItem>
        </Test>
      </MultipleSearchAndReplaceList>
    </Settings>
    But when imported it only shows the first replace for leavin' -> leaving.
    Last edited by [ss]vegeta; 1st Mar 2020 at 04:23.
    Quote Quote  
  4. Member
    Join Date
    Jul 2011
    Location
    Denmark
    Search Comp PM
    The xml structure should be like below - each rule should be in a "MultipleSearchAndReplaceItem" tag:
    Code:
    <?xml version="1.0"?>
    <Settings>
      <MultipleSearchAndReplaceList>
        <Group>
          <Name>Fix Endings</Name>
    
          <MultipleSearchAndReplaceItem>
            <FindWhat>leavin'</FindWhat>
            <ReplaceWith>leaving</ReplaceWith>
          </MultipleSearchAndReplaceItem>
    
          <MultipleSearchAndReplaceItem>
            <FindWhat>meanin'</FindWhat>
            <ReplaceWith>meaning</ReplaceWith>
          </MultipleSearchAndReplaceItem>
    
          <MultipleSearchAndReplaceItem>
            <FindWhat>lettin'</FindWhat>
            <ReplaceWith>letting</ReplaceWith>
          </MultipleSearchAndReplaceItem>
    
          <MultipleSearchAndReplaceItem>
            <Enabled>True</Enabled>
            <FindWhat>seemin'</FindWhat>
            <ReplaceWith>seeming</ReplaceWith>
          </MultipleSearchAndReplaceItem>
    
          <MultipleSearchAndReplaceItem>
            <Enabled>True</Enabled>
            <FindWhat>payin'</FindWhat>
            <ReplaceWith>paying</ReplaceWith>
          </MultipleSearchAndReplaceItem>
    
        </Group>
      </MultipleSearchAndReplaceList>
    </Settings>
    Last edited by Nikse; 1st Mar 2020 at 04:16. Reason: Shorter example + formatting
    Quote Quote  
  5. Originally Posted by Nikse View Post
    The xml structure should be like below - each rule should be in a "MultipleSearchAndReplaceItem" tag:
    Code:
    <?xml version="1.0"?>
    <Settings>
      <MultipleSearchAndReplaceList>
        <Group>
          <Name>Fix Endings</Name>
    
          <MultipleSearchAndReplaceItem>
            <FindWhat>leavin'</FindWhat>
            <ReplaceWith>leaving</ReplaceWith>
          </MultipleSearchAndReplaceItem>
    
          <MultipleSearchAndReplaceItem>
            <FindWhat>meanin'</FindWhat>
            <ReplaceWith>meaning</ReplaceWith>
          </MultipleSearchAndReplaceItem>
    
          <MultipleSearchAndReplaceItem>
            <FindWhat>lettin'</FindWhat>
            <ReplaceWith>letting</ReplaceWith>
          </MultipleSearchAndReplaceItem>
    
          <MultipleSearchAndReplaceItem>
            <Enabled>True</Enabled>
            <FindWhat>seemin'</FindWhat>
            <ReplaceWith>seeming</ReplaceWith>
          </MultipleSearchAndReplaceItem>
    
          <MultipleSearchAndReplaceItem>
            <Enabled>True</Enabled>
            <FindWhat>payin'</FindWhat>
            <ReplaceWith>paying</ReplaceWith>
          </MultipleSearchAndReplaceItem>
    
        </Group>
      </MultipleSearchAndReplaceList>
    </Settings>
    Thanks a lot for your explanation and patience.
    Keep doing the good work!
    Quote Quote  



Similar Threads