<commit_before>#!/usr/local/bin/tclsh

if {[lindex $::argv] eq "-t"} {
	# output column identifiers
	set ::argv [lrange $::argv 1 end]
	while {[gets stdin line] >= 0} {
		array unset tsv
		array set tsv [split $line "\t"]
		set result {}
		foreach term $::argv {
			if {[info exists $tsv($term)]} {
				lappend result $term $tsv($term)
			}
		}
		puts [join $result "\t"]
	}
} else {
	# no column identifiers
	while {[gets stdin line] >= 0} {
		array unset tsv
		array set tsv [split $line "\t"]
		set result {}
		foreach term $::argv {
			if {[info exists $tsv($term)]} {
				lappend result $tsv($term)
			} else {
				lappend result ""
			}
		}
		puts [join $result "\t"]
	}
}<commit_msg>smartass remark about incorrect use of info exists in tcl version<commit_after>#!/usr/local/bin/tclsh

if {[lindex $::argv] eq "-t"} {
	# output column identifiers
	set ::argv [lrange $::argv 1 end]
	while {[gets stdin line] >= 0} {
		array unset tsv
		array set tsv [split $line "\t"]
		set result {}
		foreach term $::argv {
			if {[info exists tsv($term)]} {
				lappend result $term $tsv($term)
			}
		}
		puts [join $result "\t"]
	}
} else {
	# no column identifiers
	while {[gets stdin line] >= 0} {
		array unset tsv
		array set tsv [split $line "\t"]
		set result {}
		foreach term $::argv {
			if {[info exists tsv($term)]} {
				lappend result $tsv($term)
			} else {
				lappend result ""
			}
		}
		puts [join $result "\t"]
	}
}
{'fraction_non_alphanumeric': 0.16503496503496504, 'fraction_numerical': 0.004195804195804196, 'mean_word_length': 2.96398891966759, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1239582', 'n_tokens_mistral': 613, 'n_tokens_neox': 541, 'n_words': 176}