Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to eliminate data containing "Total:" in both column A and Column B. Can I do this in Edit Script? Also how to eliminate blanks in the data. Attached is the data.
AML_Master:
LOAD A,
B
FROM
C:\Users\Country.txt
(txt, codepage is 1252, embedded labels, delimiter is '|', msq);
Thank you in advance,
Jasmine
And for the blanks, you add
AML_Master:
LOAD A,
B
len(A) as LengthA,
len(B) as LengthB
FROM
C:\Users\Country.txt
(txt, codepage is 1252, embedded labels, delimiter is '|', msq)
WHERE NOT Wildmatch(A,'*Total:') AND NOT Wildmatch(B,'*Total:');
AML_Master2:
LOAD *,
Resident AML_Master
WHERE LengthA <>0 OR LengthB<>0;
DROP TABLE AML_MASTER;
This will remove everything with a blank in either A or B, if you need it in both, then you need to use the AND operator.
Take care, length will be 0 if you have nothing in the cell, if you have e.g. a '-', it will be 1. Best to check the contents of LengthA/B first.
AML_Master:
LOAD A,
B
FROM
C:\Users\Country.txt
(txt, codepage is 1252, embedded labels, delimiter is '|', msq)
WHERE NOT Wildmatch(A,'*Total:') AND NOT Wildmatch(B,'*Total:') ;
And for the blanks, you add
AML_Master:
LOAD A,
B
len(A) as LengthA,
len(B) as LengthB
FROM
C:\Users\Country.txt
(txt, codepage is 1252, embedded labels, delimiter is '|', msq)
WHERE NOT Wildmatch(A,'*Total:') AND NOT Wildmatch(B,'*Total:');
AML_Master2:
LOAD *,
Resident AML_Master
WHERE LengthA <>0 OR LengthB<>0;
DROP TABLE AML_MASTER;
This will remove everything with a blank in either A or B, if you need it in both, then you need to use the AND operator.
Take care, length will be 0 if you have nothing in the cell, if you have e.g. a '-', it will be 1. Best to check the contents of LengthA/B first.
Thank you, Gysbert and Johan, for your quick response. They are very helpful.