ifield-book ::= %5B.%42.%3A *WSP tex-text-ifield %5D<p>
<tt>[B:..]</tt>
547473
Rule IfieldBook() {
		return Sequence(String("[B:"),
				ZeroOrMore(WSP()).suppressNode(),
				TexTextIfield(),
				String("]"))
			.label(IfieldBook);
	}
647866
Rule FieldSource() {
		return Sequence(String("S:"),
				ZeroOrMore(WSP()).suppressNode(),
				TexText(), HeaderEol()).label(FieldSource);
	}
1078211
Rule IfieldKey() {
		return Sequence(String("[K:"),
				ZeroOrMore(WSP()).suppressNode(),
				Key(),
				String("]"))
			.label(IfieldKey);
	}
456326
private boolean checkChecksumISBN13(final String isbn) {
    int sum = 0;
    for (int i = 0; i < isbn.length() - 1; i++) {
      sum += (isbn.charAt(i) - '0') * (i % 2 == 0 ? 1 : 3);
    }
    final char checkSum = isbn.charAt(12);
    return 10 - sum % 10 == checkSum - '0';
  }
1284241
Rule IfieldRhythm() {
		return Sequence(String("[R:"),
				ZeroOrMore(WSP()).suppressNode(),
				TexTextIfield(),
				String("]"))
			.label(IfieldRhythm);
	}
1005656
def relative_field(field, parent):
    
    if parent==".":
        return field

    field_path = split_field(field)
    parent_path = split_field(parent)
    common = 0
    for f, p in _builtin_zip(field_path, parent_path):
        if f != p:
            break
        common += 1

    if len(parent_path) == common:
        return join_field(field_path[common:])
    else:
        dots = "." * (len(parent_path) - common)
        return dots + "." + join_field(field_path[common:])
788463
Rule IUnusedIfield() {
		return Sequence(String("["),
				AnyOf("EIJYabcdefghijklnopqrstvxyz"),
				String(":"),
				ZeroOrMore(FirstOf(WSP(), VCHAR())),
				String("]"))
			.label(IUnusedIfield);
	}
268084
private boolean checkChecksumISBN10(final String isbn) {
    int sum = 0;
    for (int i = 0; i < isbn.length() - 1; i++) {
      sum += (isbn.charAt(i) - '0') * (i + 1);
    }
    final char checkSum = isbn.charAt(9);
    return sum % 11 == (checkSum == 'X' ? 10 : checkSum - '0');
  }
52152
Rule FieldWords() {
		return Sequence(String("W:"),
				ZeroOrMore(WSP()).suppressNode(),
				TexText(), HeaderEol()).label(FieldWords);
	}
62712
function parse_wb_bin(data, opts) {
	var wb = { AppVersion:{}, WBProps:{}, WBView:[], Sheets:[], CalcPr:{}, xmlns: "" };
	var pass = false, z;

	if(!opts) opts = {};
	opts.biff = 12;

	var Names = [];
	var supbooks = ([]);
	supbooks.SheetNames = [];

	recordhopper(data, function hopper_wb(val, R_n, RT) {
		switch(RT) {
			case 0x009C: /* 'BrtBundleSh' */
				supbooks.SheetNames.push(val.name);
				wb.Sheets.push(val); break;

			case 0x0099: /* 'BrtWbProp' */
				wb.WBProps = val; break;

			case 0x0027: /* 'BrtName' */
				val.Ref = stringify_formula(val.Ptg, null, null, supbooks, opts);
				delete val.Ptg;
				Names.push(val);
				break;
			case 0x040C: /* 'BrtNameExt' */ break;

			case 0x0165: /* 'BrtSupSelf' */
			case 0x0166: /* 'BrtSupSame' */
			case 0x0163: /* 'BrtSupBookSrc' */
			case 0x029B: /* 'BrtSupAddin' */
			case 0x016A: /* 'BrtExternSheet' */
			case 0x0169: /* 'BrtPlaceholderName' */
				break;

			/* case 'BrtModelTimeGroupingCalcCol' */
			/* case 'BrtRevisionPtr' */
			/* case 'BrtUid' */
			case 0x0817: /* 'BrtAbsPath15' */
			case 0x0216: /* 'BrtBookProtection' */
			case 0x02A5: /* 'BrtBookProtectionIso' */
			case 0x009E: /* 'BrtBookView' */
			case 0x009D: /* 'BrtCalcProp' */
			case 0x0262: /* 'BrtCrashRecErr' */
			case 0x0802: /* 'BrtDecoupledPivotCacheID' */
			case 0x009B: /* 'BrtFileRecover' */
			case 0x0224: /* 'BrtFileSharing' */
			case 0x02A4: /* 'BrtFileSharingIso' */
			case 0x0080: /* 'BrtFileVersion' */
			case 0x0299: /* 'BrtFnGroup' */
			case 0x0850: /* 'BrtModelRelationship' */
			case 0x084D: /* 'BrtModelTable' */
			case 0x0225: /* 'BrtOleSize' */
			case 0x0805: /* 'BrtPivotTableRef' */
			case 0x0254: /* 'BrtSmartTagType' */
			case 0x081C: /* 'BrtTableSlicerCacheID' */
			case 0x081B: /* 'BrtTableSlicerCacheIDs' */
			case 0x0822: /* 'BrtTimelineCachePivotCacheID' */
			case 0x018D: /* 'BrtUserBookView' */
			case 0x009A: /* 'BrtWbFactoid' */
			case 0x045D: /* 'BrtWbProp14' */
			case 0x0229: /* 'BrtWebOpt' */
			case 0x082B: /* 'BrtWorkBookPr15' */
				break;

			case 0x0023: /* 'BrtFRTBegin' */
				pass = true; break;
			case 0x0024: /* 'BrtFRTEnd' */
				pass = false; break;
			case 0x0025: /* 'BrtACBegin' */ break;
			case 0x0026: /* 'BrtACEnd' */ break;

			case 0x0010: /* 'BrtFRTArchID$' */ break;

			default:
				if((R_n||"").indexOf("Begin") > 0){/* empty */}
				else if((R_n||"").indexOf("End") > 0){/* empty */}
				else if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R_n);
		}
	}, opts);

	parse_wb_defaults(wb);

	// $FlowIgnore
	wb.Names = Names;

	return wb;
}
786608
Rule FieldNotes() {
		return Sequence(String("N:"),
				ZeroOrMore(WSP()).suppressNode(),
				TexText(), HeaderEol()).label(FieldNotes);
	}
1231106
Rule FieldDiscography() {
		return Sequence(String("D:"),
				ZeroOrMore(WSP()).suppressNode(),
				TexText(), HeaderEol()).label(FieldDiscography);
	}
624633
Rule IfieldVoice() {
		return Sequence(String("[V:"),
				ZeroOrMore(WSP()).suppressNode(),
				Voice(),
				String("]"))
			.label(IfieldVoice);
	}
724423
Rule IfieldNotes() {
		return Sequence(String("[N:"),
				ZeroOrMore(WSP()).suppressNode(),
				TexTextIfield(),
				String("]"))
			.label(IfieldNotes);
	}
1138407
private String buildCsvValue(final Field field,
                                 final String fieldValue) {


        return (areTextValuesWrapped && field.getType().equals(String.class)
                || isValueWrappable.test(fieldValue))
                ? wrapWithQuotes(fieldValue)
                : fieldValue;
    }
1130372
def field(ctx, text, index, delimiter=' '):
    
    splits = text.split(delimiter)

    # remove our delimiters and whitespace
    splits = [f for f in splits if f != delimiter and len(f.strip()) > 0]

    index = conversions.to_integer(index, ctx)
    if index < 1:
        raise ValueError('Field index cannot be less than 1')

    if index <= len(splits):
        return splits[index-1]
    else:
        return ''
573296
Rule FieldArea() {
		return Sequence(String("A:"),
				ZeroOrMore(WSP()).suppressNode(),
				TexText(), HeaderEol()).label(FieldArea);
	}