Skip to main content
added 5 characters in body
Source Link
Bera
  • 82k
  • 14
  • 85
  • 201

This will work if it looks exactly like your example. Use Python parser:

def extract(textfield):
    return textfield.split('Type')[-1].split('< td >')[1].split('<')[0].strip()

Call the function on your new field with:

extract(!Textfield!)

Change !Textfield! to match the name of your field.

You will very likely need to adapt the code, take a look at Common string operations, for example split and strip. This: [0], [-1] is indexing, see Python Lists.

Example in python console:

text = '"< html xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> < meta http-equiv="content-type" content="text/html; charset=UTF-8" > < /head > < body style="margin:0px 0px 0px 0px;overflow:auto;background:#FFFFFF;" > < table style="font-family:Arial,Verdana,Times;font-size:12px;text-align:left;width:100%;border-collapse:collapse;padding:3px 3px 3px 3px" > < tr style="text-align:center;font-weight:bold;background:#9CBCE2" > < td >Fly500< /td > < /tr > < tr > < td > < table style="font-family:Arial,Verdana,Times;font-size:12px;text-align:left;width:100%;border-spacing:0px; padding:3px 3px 3px 3px" > < tr > < td >Name< /td > < td >Fly500< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Notes< /td > < td >< /td > < /tr > < tr > < td >Source< /td > < td >< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Duplicate< /td > < td > < Null >< /td > < /tr > < tr > < td > Type < /td > < td > Wildlife Sensitive Area< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Start_Date< /td > < td >May 1< /td > < /tr > < tr > < td >End_Date< /td > < td'
def extract(textfield):
    return texttextfield.split('Type')[-1].split('< td >')[1].split('<')[0].strip()

extract(text)
'Wildlife Sensitive Area'

This will work if it looks exactly like your example. Use Python parser:

def extract(textfield):
    return textfield.split('Type')[-1].split('< td >')[1].split('<')[0].strip()

Call the function on your new field with:

extract(!Textfield!)

Change !Textfield! to match the name of your field.

You will very likely need to adapt the code, take a look at Common string operations, for example split and strip. This: [0], [-1] is indexing, see Python Lists.

Example in python console:

text = '"< html xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> < meta http-equiv="content-type" content="text/html; charset=UTF-8" > < /head > < body style="margin:0px 0px 0px 0px;overflow:auto;background:#FFFFFF;" > < table style="font-family:Arial,Verdana,Times;font-size:12px;text-align:left;width:100%;border-collapse:collapse;padding:3px 3px 3px 3px" > < tr style="text-align:center;font-weight:bold;background:#9CBCE2" > < td >Fly500< /td > < /tr > < tr > < td > < table style="font-family:Arial,Verdana,Times;font-size:12px;text-align:left;width:100%;border-spacing:0px; padding:3px 3px 3px 3px" > < tr > < td >Name< /td > < td >Fly500< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Notes< /td > < td >< /td > < /tr > < tr > < td >Source< /td > < td >< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Duplicate< /td > < td > < Null >< /td > < /tr > < tr > < td > Type < /td > < td > Wildlife Sensitive Area< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Start_Date< /td > < td >May 1< /td > < /tr > < tr > < td >End_Date< /td > < td'
def extract(textfield):
    return text.split('Type')[-1].split('< td >')[1].split('<')[0].strip()

extract(text)
'Wildlife Sensitive Area'

This will work if it looks exactly like your example. Use Python parser:

def extract(textfield):
    return textfield.split('Type')[-1].split('< td >')[1].split('<')[0].strip()

Call the function on your new field with:

extract(!Textfield!)

Change !Textfield! to match the name of your field.

You will very likely need to adapt the code, take a look at Common string operations, for example split and strip. This: [0], [-1] is indexing, see Python Lists.

Example in python console:

text = '"< html xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> < meta http-equiv="content-type" content="text/html; charset=UTF-8" > < /head > < body style="margin:0px 0px 0px 0px;overflow:auto;background:#FFFFFF;" > < table style="font-family:Arial,Verdana,Times;font-size:12px;text-align:left;width:100%;border-collapse:collapse;padding:3px 3px 3px 3px" > < tr style="text-align:center;font-weight:bold;background:#9CBCE2" > < td >Fly500< /td > < /tr > < tr > < td > < table style="font-family:Arial,Verdana,Times;font-size:12px;text-align:left;width:100%;border-spacing:0px; padding:3px 3px 3px 3px" > < tr > < td >Name< /td > < td >Fly500< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Notes< /td > < td >< /td > < /tr > < tr > < td >Source< /td > < td >< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Duplicate< /td > < td > < Null >< /td > < /tr > < tr > < td > Type < /td > < td > Wildlife Sensitive Area< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Start_Date< /td > < td >May 1< /td > < /tr > < tr > < td >End_Date< /td > < td'
def extract(textfield):
    return textfield.split('Type')[-1].split('< td >')[1].split('<')[0].strip()

extract(text)
'Wildlife Sensitive Area'
added 105 characters in body
Source Link
Bera
  • 82k
  • 14
  • 85
  • 201

This will work if it looks exactly like your example. Use Python parser:

def extract(textfield):
    return textfield.split('Type')[-1].split('< td >')[1].split('<')[0].strip()

Call the function on your new field with:

extract(!Textfield!)

Change !Textfield! to match the name of your field.

You will probablyvery likely need to adapt the code, take a look at Common string operations, for example split, strip and indexingstrip. This: (like [0][0], [-1] is indexing, [-1])see Python Lists.

Example in python console:

text = '"< html xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> < meta http-equiv="content-type" content="text/html; charset=UTF-8" > < /head > < body style="margin:0px 0px 0px 0px;overflow:auto;background:#FFFFFF;" > < table style="font-family:Arial,Verdana,Times;font-size:12px;text-align:left;width:100%;border-collapse:collapse;padding:3px 3px 3px 3px" > < tr style="text-align:center;font-weight:bold;background:#9CBCE2" > < td >Fly500< /td > < /tr > < tr > < td > < table style="font-family:Arial,Verdana,Times;font-size:12px;text-align:left;width:100%;border-spacing:0px; padding:3px 3px 3px 3px" > < tr > < td >Name< /td > < td >Fly500< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Notes< /td > < td >< /td > < /tr > < tr > < td >Source< /td > < td >< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Duplicate< /td > < td > < Null >< /td > < /tr > < tr > < td > Type < /td > < td > Wildlife Sensitive Area< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Start_Date< /td > < td >May 1< /td > < /tr > < tr > < td >End_Date< /td > < td'
def extract(textfield):
    return text.split('Type')[-1].split('< td >')[1].split('<')[0].strip()

extract(text)
'Wildlife Sensitive Area'

This will work if it looks exactly like your example:

def extract(textfield):
    return textfield.split('Type')[-1].split('< td >')[1].split('<')[0].strip()

Call the function on your new field with:

extract(!Textfield!)

Change !Textfield! to match the name of your field

You will probably need to adapt the code, take a look at Common string operations, for example split, strip and indexing (like [0], [-1])

Example in python console:

text = '"< html xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> < meta http-equiv="content-type" content="text/html; charset=UTF-8" > < /head > < body style="margin:0px 0px 0px 0px;overflow:auto;background:#FFFFFF;" > < table style="font-family:Arial,Verdana,Times;font-size:12px;text-align:left;width:100%;border-collapse:collapse;padding:3px 3px 3px 3px" > < tr style="text-align:center;font-weight:bold;background:#9CBCE2" > < td >Fly500< /td > < /tr > < tr > < td > < table style="font-family:Arial,Verdana,Times;font-size:12px;text-align:left;width:100%;border-spacing:0px; padding:3px 3px 3px 3px" > < tr > < td >Name< /td > < td >Fly500< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Notes< /td > < td >< /td > < /tr > < tr > < td >Source< /td > < td >< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Duplicate< /td > < td > < Null >< /td > < /tr > < tr > < td > Type < /td > < td > Wildlife Sensitive Area< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Start_Date< /td > < td >May 1< /td > < /tr > < tr > < td >End_Date< /td > < td'
def extract(textfield):
    return text.split('Type')[-1].split('< td >')[1].split('<')[0].strip()

extract(text)
'Wildlife Sensitive Area'

This will work if it looks exactly like your example. Use Python parser:

def extract(textfield):
    return textfield.split('Type')[-1].split('< td >')[1].split('<')[0].strip()

Call the function on your new field with:

extract(!Textfield!)

Change !Textfield! to match the name of your field.

You will very likely need to adapt the code, take a look at Common string operations, for example split and strip. This: [0], [-1] is indexing, see Python Lists.

Example in python console:

text = '"< html xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> < meta http-equiv="content-type" content="text/html; charset=UTF-8" > < /head > < body style="margin:0px 0px 0px 0px;overflow:auto;background:#FFFFFF;" > < table style="font-family:Arial,Verdana,Times;font-size:12px;text-align:left;width:100%;border-collapse:collapse;padding:3px 3px 3px 3px" > < tr style="text-align:center;font-weight:bold;background:#9CBCE2" > < td >Fly500< /td > < /tr > < tr > < td > < table style="font-family:Arial,Verdana,Times;font-size:12px;text-align:left;width:100%;border-spacing:0px; padding:3px 3px 3px 3px" > < tr > < td >Name< /td > < td >Fly500< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Notes< /td > < td >< /td > < /tr > < tr > < td >Source< /td > < td >< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Duplicate< /td > < td > < Null >< /td > < /tr > < tr > < td > Type < /td > < td > Wildlife Sensitive Area< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Start_Date< /td > < td >May 1< /td > < /tr > < tr > < td >End_Date< /td > < td'
def extract(textfield):
    return text.split('Type')[-1].split('< td >')[1].split('<')[0].strip()

extract(text)
'Wildlife Sensitive Area'
Source Link
Bera
  • 82k
  • 14
  • 85
  • 201

This will work if it looks exactly like your example:

def extract(textfield):
    return textfield.split('Type')[-1].split('< td >')[1].split('<')[0].strip()

Call the function on your new field with:

extract(!Textfield!)

Change !Textfield! to match the name of your field

You will probably need to adapt the code, take a look at Common string operations, for example split, strip and indexing (like [0], [-1])

Example in python console:

text = '"< html xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> < meta http-equiv="content-type" content="text/html; charset=UTF-8" > < /head > < body style="margin:0px 0px 0px 0px;overflow:auto;background:#FFFFFF;" > < table style="font-family:Arial,Verdana,Times;font-size:12px;text-align:left;width:100%;border-collapse:collapse;padding:3px 3px 3px 3px" > < tr style="text-align:center;font-weight:bold;background:#9CBCE2" > < td >Fly500< /td > < /tr > < tr > < td > < table style="font-family:Arial,Verdana,Times;font-size:12px;text-align:left;width:100%;border-spacing:0px; padding:3px 3px 3px 3px" > < tr > < td >Name< /td > < td >Fly500< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Notes< /td > < td >< /td > < /tr > < tr > < td >Source< /td > < td >< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Duplicate< /td > < td > < Null >< /td > < /tr > < tr > < td > Type < /td > < td > Wildlife Sensitive Area< /td > < /tr > < tr bgcolor="#D4E4F3" > < td >Start_Date< /td > < td >May 1< /td > < /tr > < tr > < td >End_Date< /td > < td'
def extract(textfield):
    return text.split('Type')[-1].split('< td >')[1].split('<')[0].strip()

extract(text)
'Wildlife Sensitive Area'