Parsing fields from class list files to use output with newusers command

Hello I am trying to develop a shell script that takes a text file such as this...

E-mail@ Soc.Sec.No. *--------Name-----------* Class *School.Curriculum.Major.* Campus.Phone
JCC2380 XXX-XX-XXXX CAREY, JULIE C            JR-II BISS CPSC BS   INFO TECH   412/779-9445 
JAC1936 XXX-XX-XXXX CONSOLMAGNO, JOE A.       SO-I  BISS CPSC BS   INFO TECH   412/833-7993 
ACC4636 XXX-XX-XXXX CURRIE, ADAM C.           JR-II BISS CPSC BS   COMP SCI    724/657-0437 
SPF1696 XXX-XX-XXXX FARLEY, SEAN P.           JR-I  BISS CPSC BS   COMP SCI    814/236-2398 
SEK8835 XXX-XX-XXXX KELLEY, SHAWN E.          FR-II BISS CPSC BS   COMP SCI    724/406-7149 
MCK0599 XXX-XX-XXXX KOMISIN, MICHAEL C.       JR-I  BISS CPSC BS   COMP SCI    000/000-0000 
GJM1887 XXX-XX-XXXX MACK, GREGORY J.          SO-II BISS CPSC BS   INFO TECH   724/735-4354 
NGM5479 XXX-XX-XXXX MCINTIRE, NICHOLAS G      JR-I  BISS CPSC BS   INFO TECH   724/794-8268 
ZTP7190 XXX-XX-XXXX PETAK, ZACHARY T.         FR-II BISS CPSC BS   INFO TECH   724/406-1298 
AXS9097 XXX-XX-XXXX SAUNDERS, ALEXANDER       SO-I  BISS CPSC BS   INFO TECH   724/334-0313 
RJS6624 XXX-XX-XXXX SNYDER, ROBERT J.         SO-II BISS CPSC BS   COMP SCI    814/328-2021 
MWS1990 XXX-XX-XXXX STASNY, MATTHEW W         SO-II BISS CPSC BS   INFO TECH   412/882-0581 

from the command line and then the output would be the <i>username:password</i>

The user name is the email name but it must be lowercase instead of uppercase, and the password is the first letters class, school, curriculum and major followed by the last 4 digits of the user's phone number.

The output of should look something like this...

jcc2380:jbci9445
jac1936:sbci7993

I am using the output with the newusers command to create new accounts in our system, but I am not very good with my parsing to produce this output

Many thanks,
Crim

Assumption: file is fixed width and you want chars at 47,53,58 and 68 plus last 4 chars of input line for password.

awk 'BEGIN { c=split("47,53,58,68", A, ",") }
NR>1 {
   pw=""
   for(p=1; p<=c;p++)
        pw=pw substr($0, A[p], 1)
   print tolower($1 ":" pw substr($0,length - 3)) }' infile
awk 'function f (str) {return substr(str,1,1)}
     NR>1{pw=f($(NF-6)) f($(NF-5)) f($(NF-4)) f($(NF-2));
          split($NF,a,"-");
          print tolower($1 ":" pw a[2])}' infile

@rdcwayx your solution assumes that Major and Curriculum always have two words

Cheers for the help both you of. And to answer your question yes Chubler the files all have the same character match up

Most awks can do this too:

awk 'NR>1{split($0,c,x);print tolower($1 ":" c[47] c[53] c[58] c[68] c[88] c[89] c[90] c[91])}' infile

or:

awk 'NR>1{print tolower($1 $2 $3 $3 $5 $6 $7 ":" $47 $53 $58 $68 $88 $89 $90 $91)}' FS= infile

Through Sed..

sed '1d;s/^\([^ ]*\) [^ ]* [^ ]* [^ ]* [^ ]*  *\(.\)[^ ]*  *\(.\)[^ ]*  *\(.\)[^ ]* [^ ]*  *\(.\)[^ ]* [^ ]*  *.*-\(.*\)/\1:\2\3\4\5\6/;h;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' inputfile
cut -c-7,47,53,58,68,88-91 infile | sed '1d;s/./&:/7' | tr [:upper:] [:lower:]