我有这个脚本,它用于比较两个文件中的第一个字段,我希望它忽略大小写,尝试添加一行 IGNORECASE = 1; 但似乎不起作用,
你能告诉我如何忽略案例吗?
BEGIN {
FS=OFS=";"
}
FNR==NR {
array[$1]=$2
next
}
{
if ($1 in array) {
print $1";" array[$1]";" $2
}
else {
if ($2 in values) {
print $1";" "only_at_" FILENAME ";" $0 " same path as " values[$2]
}
else {
print $1";" "only_at_" FILENAME ";" $0 " no path found"
}
}
values[$2]=$1
}
假设我有
文件 1
\\FILE48\bucan-CFAN_Subcommittees;\\SERVER24\dfs\Shared\can\CFAN Subcommittees
文件2
\\file48\bucan-CFAN_Subcommittees;/fs8_100g/FILE48/BU/can/CFAN Subcommittees
\\FILE58\userhome_e;/fs1_100g/FILE58/userhome
预期产出
\\FILE48\bucan-CFAN_Subcommittees;\\SERVER24\dfs\Shared\can\CFAN Subcommittees;/fs8_100g/FILE48/BU/can/CFAN Subcommittees
\\MLISFILE58\userhome_e;only_at_file2;\\MLISFILE58\userhome_e;/fs1_100g/MLISFILE58/userhome no path found