Basically I want to run a SQL statement against each record in this file (hundreds of lines):
sample input:
233333
233334
233335
233336
I want to do the following:
Add a some text at the beginning to prepare the SQL (3 lines)
Add some text at the end for cleanup (4 lines)
Remove whitespace at the end - SORTED sed 's/[ \t]*$//' - seems to leave 2 spaces?!!??!)
Add a letter 'a'to the end - SORTED (awk 'print $0 "a"})
Now the complicated part, I want to take the number above and make it look like the sample output below. The same for each line.....!?
COPY BATCH_233333a INTO /dir/dir/dir/BATCH_233333a.txt
COPY BATCH_233334a INTO /dir/dir/dir/BATCH_233334a.txt
COPY BATCH_233335a INTO /dir/dir/dir/BATCH_233335a.txt
COPY BATCH_233336a INTO /dir/dir/dir/BATCH_233336a.txt