[Solved] CS213 Assignment 9 -Sed

$25

File Name: CS213_Assignment_9__Sed.zip
File Size: 216.66 KB

SKU: [Solved] CS213 Assignment 9 -Sed Category: Tag:
5/5 - (1 vote)

Rate this product

  1. script1.sh:Write a sed command/script to emulate wc -l command. This file is run as a bash script by typing : . script1.sh filename.txt
  2. script2.sedWrite a sed script which takes an input file and puts a line number at the beginning of each line.This file is run as a bash script by typing : . script2.sh filename.txt For example :input.txt has the following contents:this is first linethis is third line this is fourth line.1

should be written to output.txt as follows: See that all blank lines also get a number.(1) this is first line

(2)(3) this is third line

(4)

this is fourth line

3. script3.sed:Given input files contains new-lines and white spaces and tabs. Write a sed script to

  1. (a) Remove all leading spaces
  2. (b) Collapse every sequence of white spaces between two words in a single line into a single space, and
  3. (c) Collapse every sequence of white spaces between two lines into a single newline. All other suffix and prefix whitespaces are to be deleted.
  4. (d) Print the output to screen. For example

how are you

fine.

becomes

how are you fine.

4. script4.sed :There is a text file called input.txt such that there are four strings on each line.

For example:

VeenaDaniel Raj 3456 Veena Michael Raj3456

2

This has to be written so that all four fields in the record (line) are sepa- rated by a single tab. Therefore above output looks like

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS213 Assignment 9 -Sed[Solved] CS213 Assignment 9 -Sed
$25