Client gave me a list of do not call numbers that has 10 digits on a line. We only have 3, 6 and 7 digits phone scrubs. Using the 7 digit scrub I should be able to use the file the client gave us as a seven digit scrub if I just remove the last three digits from each number in the clients do not call list. The clients list has 686,930 numbers in it. My usual approach of recording an emacs macro just bogged down the computer and there is also this weird error when I use C-u with large numbers (i gave it the prefix of 100k) and it bombed out after 25k or so). Anyway, I though about it for a minute and then played around with awk and sed until I came up with this:
awk ’ {print $1} ’ UT_suppress.txt | sed ‘s/[0-9][0-9][0-9]$//’ > UT_supress_7digit.txt
Done in less than a minute and I now have a file with seven digits on each line that will not send any numbers on the clients do not call list. Now I am just waiting for the utility script to load that file into the database and its not nearly as fast as awk and sed. So, I have time to write this :) Yeah, so that script just locked up my browser. A slightly modified file via:
cat UT_suppress_7.txt | uniq > UT_suppress_7_uniq.txt
only has 189k lines in it. Maybe the upload script will like that better.