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

    Join Date
    Dec 2013
    Posts
    1
    Rep Power
    0

    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
    3
    4


    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
    Posts
    30
    Rep Power
    1
    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 Intermediate (1500 - 1999 posts)

    Join Date
    Apr 2009
    Posts
    1,938
    Rep Power
    1225
    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.

    http://mars.netanya.ac.il/~scriplan/...CES/ex1s13.pdf

    Comments on this post

    • Laurent_R agrees

IMN logo majestic logo threadwatch logo seochat tools logo