1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Rep Power

    Hello, everyone! i need some help, please

    i need to write 2 scripts:
    1). script named P1 that takes filename as input, creates P1.half as output, that contains content of original file, but every word with even length must be replaced with it first half.
    for example:
    if original file contains:
    aab ccccf 123A
    ccc 123a wwwwww ccc 61234 77
    88888 uuuu 2 uuuuu ccccf

    P1.half must contain:
    aab ccccf 12
    ccc 12 www ccc 61234 7
    88888 uu 2 uuuuu ccccf

    2) script P2 that takes filenames as parameters, and print output (to screen) - one line for every filename that contains: name of a filename, one space, a mount of different words in a file.
    in addition the output must be sorted in alphabetic order of filename.
    the last line must contain names of filenames with the largest mount of words. the names have to be seperated by space, and sorted in alpabetic order
    for example, there are several files that contains:
    A B C K E
    a a b ab ab ab 20 xyza abcd 1
    b b a 5 4 6 200 xyz 2

    after running P2 A B C K E, the output will be:
    A 2
    B 4
    C 4
    E 4
    K 1
    B C E
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Rep Power
    How would you do these "assignment" on own? People can only help you learn not do your work for you.
    Show what you have done, where you are getting error, what error messages. Then people can help and you too can learn.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Apr 2009
    Rep Power
    Before anyone helps you with this question, maybe you should address Kenosis concern that this is a homework assignment.

    Your perlguru thread

    Your second perlguru thread

    My company is blocking the domain of the link Kenosis posted which I assume is the assignment specs, but I'll repost it here.


    Comments on this post

    • Laurent_R agrees

IMN logo majestic logo threadwatch logo seochat tools logo