
TV005030
New User
May 3, 2010, 4:29 PM
Post #1 of 2
(1378 views)
|
|
CLEAN 'DIRTY' DATA FILE
|
Can't Post
|
|
Hello everyone! Help, please! I am so new to Perl and I am supposed to write a script. I don't even know where to start :((( I would really appreciate if someone take the time to help me. I realize it is something easy for experienced Perl programmer. The script is supposed to: Write a script that A. Provides a user interface that requests the user to input a filename B. Generates an output file called otcout.txt with following features: 1.) Lists entries in ascending alpha order (a-z) 2.) Has no quotation marks 3.) Is formatted so the columns are even 4.) Inserts the area code as (417) 5.) Inserts the exchange prefix as 447 unless specifically marked otherwise 6.) Inserts dashes between area code, exchange prefix, and line number Samples of input and output A. Input "Pope, David 7274" "Christy, Kathy 7208" "Payne, Dennis 7035" "Moore, Sue 7101" "Patterson, Ty 7132" "Church, Alan 7199" "Williams, Amanda 7255" "Chriswell, Arlene 7154" "Chism, Vanda 5741" "Childress, Layton 532-8040" B. Output Childress, Layton (417)-532-8040 Chism, Vanda (417)-447-5741 Christy, Kathy (417)-447-7208 Chriswell, Arlene (417)-447-7154 Church, Alan (417)-447-7199 Moore, Sue (417)-447-7101 Patterson, Ty (417)-447-7132 Payne, Dennis (417)-447-7035 Pope, David (417)-447-7274 Williams, Amanda (417)-447-7255 I have attached the input file (otcfolks.txt) with the 'dirty' data which I am supposed to format. Thank you very much! I can't explain you how much your help means to me!
|