Re: Access 1st 12 charectors of a word.
Dave Kelly wrote:
> I have a list that is 3 words to each line.
> I know how to read the file.
> I need only the first 12 character of the 3 word. This word is not
> guaranteed to be 12 character long. This is where I'm stuck.
>
> Is there an equivalent to the old basic 'left$'? Where do I find it?
>
> What do I search Google for?
>
> TIA Dave
I did not provide enough information. My apologies.
I am developing a protected directory on my web server. This directory
will contain a membership list. If you are on the membership list you
can download the membership list.
I want the user name to be the first name and last name with no spaces
in between the 2 words. The password will be the format of the 1st 12
characters of the email address.
The membership is put together with excel, sent to me as a cvs file and
takes the form:
Kelly,Dave,10371 Renfaire
Drive,Plantersville,TX,77363,(936)xxx-1xx0,,,1/30/2001
0:00,daveekelly@xxxxxxxxx.net,R,6/30/2005 0:00,2005-2006,,
code I had started:
#!/bin/bash
main()
{
IFS=, ; while read "LastName" "FirstName" "Address" "City" "State" \
"ZipCode" "HomePh" "BusinessPh" "tmp" "DateJoined" "email" \
"MembershipType" "RenewalDate" "MembershipYear" "Paid" "Notes";
do make_list "$LastName" "$FirstName" "$email" ; done
}
make_list()
{
Email=cut -c12 "$email";
echo >> "$firstname""$lastname","$Email"
}
main
Im currently chasing this error "./pdlist.sh: line 14: -c12: command not
found"
|