Hello, You can use the split() function to seperate each string by a delimiting character, such as a comma. For example, in your first line-- Tomy Savage:408-724-0140:1222 Oxbow Court, Sunnyvale,CA 94087:5/19/66:34200
Given that the fields you want are always before, and directly after the second comma, something to do this would be as follows given that $line contains one string of data. ($junk, $city, $statefield) = split(/,/, $line); #Seperate the first 2 characters of the field containing the state to get the two letter abbreviation. $state = substr($statefield, 0, 2); I'm not sure if your input file really contains newline characters or not - I suspect your e-mail client just wrapped the input. If that's not the case, however, you might need to do a little tinkering to get the $city and $state variables where you want them. I'm not at a machine where I can check this right now, but let me know if it works for you. Thanks, Robert Aspinall V-ONE Corporation [EMAIL PROTECTED] ----- Original Message ----- From: "suraj rajendran" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 04, 2002 6:35 PM Subject: Simple question > Hi, > > How do I just print only the City and State where > person lives assuming that I have the following data. > Thanks > > > __DATA__ > Tomy Savage:408-724-0140:1222 Oxbow Court, > Sunnyvale,CA 94087:5/19/66:34200 > Lesle Kerstin:408-456-1234:4 Harvard Square, Boston, > MA 02133:4/22/62:52600 > JonDeLoach:408-253-3122:123 Park St., san Jose, CA > 94086:7/25/53:85100 > Ephram Hardy:293-259-5395:235 Carlton Lane, Joliet, IL > 73858:8/12/20:56700 > Betty Boop:245-836-8357:635 Cutesy Lane, Hollywood, CA > 91464:6/23/23:14500 > William Kopf:846-836-2837:6937 Ware Road, Milton, PA > 93756:9/21/46:43500 > Norma Corder:397-857-2735:74 Pine Street, Dearborn, MI > 23874:3/28/45:245700 > James Ikeda:834-938-8376:23445 Aster Ave., Allentown, > NJ 83745:12/1/38:45000 > Lori Gortz:327-832-5728:3465 Mirlo Street, Peabody, MA > 34756:10/2/65:35200 > Barbara Kerz:385-573-8326:832 Ponce Drive, Gary, > > __________________________________________________ > Do You Yahoo!? > Yahoo! Sports - sign up for Fantasy Baseball > http://sports.yahoo.com > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]