﻿file = r'resources\views\panel-tests\divisi\create.blade.php'
with open(file, 'r', encoding='utf-8') as f:
    c = f.read()

old = '                        @endif\n                        {{-- Region --}}'
new = '                        @endif\n                        @endif\n                        {{-- Region --}}'

if old in c:
    c = c.replace(old, new, 1)
    print("OK!")
else:
    # Cari posisi manual
    idx = c.find('{{-- Region --}}')
    print(repr(c[idx-60:idx+20]))

with open(file, 'w', encoding='utf-8') as f:
    f.write(c)
