Question

Create a file with the following information called presidents, using vi or pico, and again press the [tab] key between...

Create a file with the following information called presidents, using vi or pico, and again press the [tab] key between fields. Once again, make sure you include the line numbers (6,7,8, etc)

6 Abe Lincoln honest

7 James Munroe doctrine

8 Harry Truman buck.stops

9 James Madison civil.war

10 Jimmy Carter peanuts

Append presidents to people using cat, call the new file peopletwo.

Enter the command used to do the append:__________________________________

Remove the line numbers and the first tab stop, then sort by last name as the primary field.

Enter the command used to do the remove:__________________________________

Enter the command used to do the sort:_____________________________________

Replace all Upper case letters of peopletwo with lower case letters.

Enter the command used to do the replace:__________________________________

Cut all of the first names out and place them in a file called first.

Enter the cut command used:_____________________________________________

Cut all of the last names out and place them in a file called last.

Enter the cut command used:_____________________________________________

A vi visual would be nice please

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.Appending command (assuming people is another file)

cat presidents people > peopletwo

s cat presidents.txt people.txt >peopletwo.txt

output:

$ sed s/[A-z]/L&/g peopletwo.txt abe james munore doctrine harry truman buck.stop james madisom civil.war jimmy carter pean

2.commad to remove

sed 's/^[0-9]*\t*//' presidents.txt

$ cat presidents.txt Abe Lincoln honest James Munore Doctrine Harry Truman buck. stop James Madisomcivil.war 10 Jimmy Carter

3.sort

sed 's/^[0-9]*\t*//' presidents.txt |sort -k2

s sed s/A[o-9]t*/ presidents.txt Isort -k2 immy Carter peanuts AbeLincoln honest James Madisom civi1.war James Munore Doctri

4.replace

sed 's/[A-Z]/\L&/g' peopletwo.txt

s sed s/[A-ZIAL&/g peopletwo.txt incoln honest james munore doctrine harry truman buck.stop james madisom civil.war jimmy c

5.cut first names and past in first.txt

cat presidents.txt | cut -f 2 > first.txt

cat first.txt Abe ames arry ames

6.cut last names and past in last.txt

cat presidents.txt | cut -f 3 > last.txt

s cat presidents.txt I cut -f 3> last.txt cat last.txt Lincol Munore Truman Madisonm Carter

Add a comment
Know the answer?
Add Answer to:
Create a file with the following information called presidents, using vi or pico, and again press the [tab] key between...
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
  • Create a file with the following information using either vi. 1 Ida Rather teacher 2 Adrian...

    Create a file with the following information using either vi. 1 Ida Rather teacher 2 Adrian Wall Historian 3 Grant Hill Sportsman 4 Bill Gates Genius 5 Alex Bell Inventor Sort file people by their last name, placing the results in a file called peoplelast. (Check your work by displaying peoplelast with the command more peoplelast.) Enter the sort command used: _______________________________________ Sort the original file people by their 'Occupation', displaying the output on the screen. Enter the sort command...

  • Open vi or pico and create a script called Information.   Add the contents from the following table to the script: (Hin...

    Open vi or pico and create a script called Information.   Add the contents from the following table to the script: (Hint: use echo to add blank lines to your output and to write out the headings). Headings: Utilities (command to execute) Today’s date is: date The current users logged on to the system are: who My current startup directory is: pwd Today’s identification information is: id The processes running on my system are: ps Add a header to your Information...

  • Really need help from 11 on: Create the directory structure IFT383FinalExam/Activities/Activity1 in your home directory. Using...

    Really need help from 11 on: Create the directory structure IFT383FinalExam/Activities/Activity1 in your home directory. Using the cat command, create a file named classRoster with the following fields, separated by a comma. Student ID First Name Last Name Grade Program of Study ASURITE ID (username) Add three records to your file. Display the contents of the file. Move the file classRoster to the directory Activity1. Go to the Activity1 directory. Display the directory you are in. Add read, write and...

  • in python please PROBLEM : (15 POINTS Use the file 'presidents age, txt You can download...

    in python please PROBLEM : (15 POINTS Use the file 'presidents age, txt You can download this file from D2L (Content' tab) to your lo computer This file contains the age (at the time of their inaguration) of the first 45 presidents (including repeats). Each president's name is separated from his age by a comma Write a function called getAges (). Inside this function, create a dictionary in which every key is the name, and the value is the president's...

  • Using Python INST-FS-IAD-PROD.INS LAB1 Lab: Create User Account 2. get-password() #promt the user and create password, check the password fits the requirement USE the EXACT file names! Create a user...

    Using Python INST-FS-IAD-PROD.INS LAB1 Lab: Create User Account 2. get-password() #promt the user and create password, check the password fits the requirement USE the EXACT file names! Create a user login system. Your code should do the following: 3, create-user_name() #use this function to create the user name 1.Create your user database called "UD.txt", this should be in CSV format 4, write-file() #user this function to save the user name and password into "UD.txt" Deliverables: Sample: the data you saved...

  • 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...

  • Implement the histogram function to complete the desired program. You must use dynamically allocated arrays for...

    Implement the histogram function to complete the desired program. You must use dynamically allocated arrays for this purpose. For your initial implementation, use ordered insertion to keep the words in order and ordered sequential search when looking for words. Note that the array utility functions from the lecture notes are available to you as art of the provided code. Although we are counting words in this program, the general pattern of counting occurrences of things is a common analysis step...

  • Requirements Create an Address Book class in Java for general use with the following behaviors: 1....

    Requirements Create an Address Book class in Java for general use with the following behaviors: 1. Constructor: public Address Book Construct a new address book object. • A contact has four fields: first name, last name, email and phone. (There could be more information for a real contact. But these are sufficient for the assignment.) . The constructor reads from the disk to retrieve previously entered contacts. If previous contacts exist, the address book will be populated with those contacts...

  • For this c++ assignment, Overview write a program that will process two sets of numeric information....

    For this c++ assignment, Overview write a program that will process two sets of numeric information. The information will be needed for later processing, so it will be stored in two arrays that will be displayed, sorted, and displayed (again). One set of numeric information will be read from a file while the other will be randomly generated. The arrays that will be used in the assignment should be declared to hold a maximum of 50 double or float elements....

  • Edit a C program based on the surface code(which is after the question's instruction.) that will...

    Edit a C program based on the surface code(which is after the question's instruction.) that will implement a customer waiting list that might be used by a restaurant. Use the base code to finish the project. When people want to be seated in the restaurant, they give their name and group size to the host/hostess and then wait until those in front of them have been seated. The program must use a linked list to implement the queue-like data structure....

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