Menu

[Solved]-Use Testfile1txt Carry Following Tasks Write Results Single File Named Outputtxt 1 Using S Q37286221

Use the testfile1.txt to carry out the following tasks and writethe results in a single file named as your output.txt

1. Using a sed command, add a line of 20 dashes after eachline.

2. Using a sed command, add .00 to all the numbers in the lastcolumn.

3. Using an awk command, print first and last columns only withlast column printed first.

4. Using an awk command, add a header line with Make, Model,Year, K Miles, and Price aligned with the columns followed by adashed line and then all of the data in the file with the followingchanges: the last column includes a $ sign followed by the numberexpressed as a floating point number with two digits following thedecimal point i.e., 2500 appears as $2500.00, and so on.

testfile1.txt
plym    fury   1970    73      2500
chevy   malibu 1999   60       3000
ford    mustang 1965   45       10000
volvo   s80    1998    102      9850
ford    thundbd 2003   15       10500
chevy   malibu 2000   50       3500
bmw     325i   1985    115      450
honda   accord 2001   30       6000
ford    taurus 2004   10       17000
toyota rav4    2002   180      750
chevy   impala 1985   85       1550
ford    explor 2003   25       9500

Expert Answer


Answer to Use the testfile1.txt to carry out the following tasks and write the results in a single file named as your output.txt 1… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *