Question: Sample Input in file 'a' : 5 100 c 23.5 200 a 34.5 40 b 27.257 130 d 90 10 e 100.1256 Sample Output in
Sample Input in file 'a' :
5 100 c 23.5 200 a 34.5 40 b 27.257 130 d 90 10 e 100.1256
Sample Output in file 'b.txt' :
5 10 e 100.126 40 b 27.257 100 c 23.5 130 d 90 200 a 34.5

Help pls.. In C Programming The program will take 3 arguments (in order) - choice infile outfile Note: The infile and outfile can contain path such as /tmp/HW1_test1.txt and /tmp/HW1_xxxx.out If the choice is 1, implement the "copy" function that will read the infile, convert the content to all upper cases, and save the result to the outfile. The outfile format should be the same as the infile. . If the choice is 2, implement the "sort" function that will read the infile, sort the content by descending order (a-z), and save the first 10 characters for each line to outfile. The outfile format should be the same as the infile. If the choice is 3, implement the "wc" that will read the infile, count and display the number of words, number of lines, save the result to the outfile. You need to handle the following situations and stop the program when they happen. If the number of command-line arguments is not 3, print the help manual about how to run the program. Syntax: HW1_XXXX choice infile outfile If the choice is not 1, 2 or 3, print an error message "Wrong choice, the only available values are 1, 2, 3". If the infile is not found, display an error message "Error! No such file - infile" If the outfile cannot be written, display an error message "Error! Cannot save file - outfile". Help pls.. In C Programming The program will take 3 arguments (in order) - choice infile outfile Note: The infile and outfile can contain path such as /tmp/HW1_test1.txt and /tmp/HW1_xxxx.out If the choice is 1, implement the "copy" function that will read the infile, convert the content to all upper cases, and save the result to the outfile. The outfile format should be the same as the infile. . If the choice is 2, implement the "sort" function that will read the infile, sort the content by descending order (a-z), and save the first 10 characters for each line to outfile. The outfile format should be the same as the infile. If the choice is 3, implement the "wc" that will read the infile, count and display the number of words, number of lines, save the result to the outfile. You need to handle the following situations and stop the program when they happen. If the number of command-line arguments is not 3, print the help manual about how to run the program. Syntax: HW1_XXXX choice infile outfile If the choice is not 1, 2 or 3, print an error message "Wrong choice, the only available values are 1, 2, 3". If the infile is not found, display an error message "Error! No such file - infile" If the outfile cannot be written, display an error message "Error! Cannot save file - outfile
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
