December 18th, 2013, 12:02 PM
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.
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:
B C E
December 18th, 2013, 02:02 PM
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.
December 18th, 2013, 02:03 PM