Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dkalthoff

macrumors newbie
Original poster
Nov 5, 2009
2
0
I have a basic understanding of what Applescript does, I have knowledge of AS2.0, HTML and a bit of Java.

That being said, I have a list of about 150,000 addresses that I plan on mailing, but they are formatted with a few numbers before the actual address that are completely irrelevant. I want to have TextEdit delete the first 9 characters on every line (every address is on a separate line). In order to save some time, I tried to use the script builder to make a script to delete them for me but to no avail.

Could anyone here help me?
 
Not sure in applescript, but in shell:
cat test.txt | awk '{print substr($0,10,length($0)-1)}'

In this cast, test.txt looked like:
012345678 ABC Tded Bd
012345678 ABC Tded Cc
012345678 ABC Tded Dd
012345678 ABC Tded Ee
012345678 ABC Tded Ff


The output is:
ABC Tded Bd
ABC Tded Cc
ABC Tded Dd
ABC Tded Ee
ABC Tded Ff

You can redirect the output to a new file, and the job should be done.

-Lee
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.