Hi,
I a large file1. I want to search it for lines that contain the same value in file2. If the values match then remove the row from file 1.
Example of file1
5937000862 |414160|"SP"|"S"|"PRUEBAS"||20011025|+0000024.13|20011024|932
5937000000 |696781|"SP"|"A"|"JACQUELINE JANET"|20020503|20020704|+0000000.52|20020824|942
Example of file2
5937000862
I've used the following script, but get errors
BEGIN {
while ((getline < "file1" > 0) {
array[$1]= $1
}
}
{
for (i in array) {
if ($1 == i) {
"" = array
}
}
print
}' file2
*********
errors returned;
[larson tecnomen ] /export/home/migration/revC> ./NoFailScript3
awk: syntax error near line 3
awk: illegal statement near line 3
awk: syntax error near line 7
awk: bailing out near line 7
I a large file1. I want to search it for lines that contain the same value in file2. If the values match then remove the row from file 1.
Example of file1
5937000862 |414160|"SP"|"S"|"PRUEBAS"||20011025|+0000024.13|20011024|932
5937000000 |696781|"SP"|"A"|"JACQUELINE JANET"|20020503|20020704|+0000000.52|20020824|942
Example of file2
5937000862
I've used the following script, but get errors
BEGIN {
while ((getline < "file1" > 0) {
array[$1]= $1
}
}
{
for (i in array) {
if ($1 == i) {
"" = array
}
}
}' file2
*********
errors returned;
[larson tecnomen ] /export/home/migration/revC> ./NoFailScript3
awk: syntax error near line 3
awk: illegal statement near line 3
awk: syntax error near line 7
awk: bailing out near line 7