Question

Create and save a new text file called Gasoline that consists of the following content: Gas prices stayed about the sa...

  1. Create and save a new text file called Gasoline that consists of the following content:

Gas prices stayed about the same the past two weeks, continuing an unusual 12 week trend of steadily increasing prices followed by prices relaxing.

The average price for gas nationwide, including all grades and taxes, was about $2.61 a gallon on Friday, according to a survey of 8,000 stations released Sunday. That was up .06 cents per gallon from the prior survey. Prices have been holding steady recently, indicating that the global market for gasoline is stabilizing.

  1. Create an analysis script called TestScript that completes the following tasks for the Gasoline file:
    1. Remove punctuation
    2. Make all characters lowercase
    3. Put each word on a single line
    4. Remove blank lines
    5. Sort the text to put all lines containing the same word on adjacent lines
    6. Remove duplicate words from the text
    7. List most-used words in the file first
    8. Send the output of this script to a file named ScriptResult
  1. Save the script. Make it executable. Run the script.
  2. Open the ScriptResult file and verify that the contents match what was asked for in the TestScript script.
  3. Copy and paste the windows for your TestScript script and your ScriptResult file. Paste them into this lab for turn-in.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

# TestScriptsh # #l/bin/bash printf n- Removed Blank Lines ScriptResult val3-S(sed AS/d Gasoline) echo Sval3 >ScriptResult p

Add a comment
Know the answer?
Add Answer to:
Create and save a new text file called Gasoline that consists of the following content: Gas prices stayed about the sa...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • linux help Create a file called trees, containing the following individual lines: Oak tree Pine Tree...

    linux help Create a file called trees, containing the following individual lines: Oak tree Pine Tree Spruce tree Cottonwood Maple tree Pine Tree Copy in the contents of the trees to more_trees file. Next, add the following trees at the end of the list. Redwood Willow tree Use a command to compare the trees and more_trees files and show the differences in terms of individual lines that differ. Determine the number of bytes in both the trees and more trees...

  • VI Exercise Ex 1. At your home directory, create a new file “test1” which contains following...

    VI Exercise Ex 1. At your home directory, create a new file “test1” which contains following 2 lines, save and exit. Hello, This is my vi test file SOI Asia project stands for School of Internet Asia project Ex 2. Edit file “test1” to contain following content. Change content on first line by using command “x” to delete unwanted characters and then inserting desired texts. Then use “G” to go to last line and press “o” to insert text at...

  • 1. Expense Pie Chart Create a text file that contains your expenses for last month in...

    1. Expense Pie Chart Create a text file that contains your expenses for last month in the following categories: -Rent -Gas -Food -Clothing -Car Payment -Misc Write a Python program that reads the data from the file and uses matplotlib to plot a pie chart showing you how you spend your money. 2. 1994 weekly gas graph The text file named 1994_Weekly_Gas_Averages.txt contains the average gas price for each week in the year 1994. (There are 52 lines in the...

  • The following code uses a Scanner object to read a text file called dogYears.txt. Notice that...

    The following code uses a Scanner object to read a text file called dogYears.txt. Notice that each line of this file contains a dog's name followed by an age. The program then outputs this data to the console. The output looks like this: Tippy 2 Rex 7 Desdemona 5 1. Your task is to use the Scanner methods that will initialize the variables name1, name2, name3, age1, age2, age3 so that the execution of the three println statements below will...

  • LINUX QUESTIONS (dont have to display output, I will be running these commands myself to check...

    LINUX QUESTIONS (dont have to display output, I will be running these commands myself to check the output) Display the command(s) used to do the following: create an empty file called history by using just a redirection operator. Verify and show. Show/verify all results (i.e., all commands and their corresponding outputs). Wait 1 minute or more and then display the command(s) used to do the following: change the timestamp on the history file you just created. Verify/display the change. Show/verify...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT