PUT Command
Another way you can insert part of a file into another file is to use the PUT command. The PUT command lets you insert lines from a current file into a second file.
The PUT command stores a copy of a certain number of lines, starting with the current line. You can then append the stored lines to the end of another file.
The format of the PUT command is:
PUT number-of-lines filename filetype filemodeThe command puts the number of lines into the file you specify.
Another way to tell the editor how many lines you want to put is by typing a string. Remember the LOCATE command? When you learned about the LOCATE command, you searched files for a certain word or words—a string. You can also use a string with the PUT command. You can tell the editor to put all the lines, starting with the current line, up to but not including the line with the string.
PUT /string/ filename filetype filemodeTherefore, both PUT number-of-lines and PUT /string/ do the same thing.
Let us insert part of the STOCK INVEN file into CRIME THEFT.
x stock inven03469 GASKET AA0306 9432
32554 RATCHET AA0205 3762
32868 DOOHICKEY BB0206 5248
64400 GIZMO CC0101 9942
09263 WIDGET AA0403 8645
60637 THINGAMABOB BB0202 5432
26023 WHATCHAMACALLIT BB0306 9321We are going to insert the first two lines of STOCK INVEN after the last line in CRIME THEFT. So make the first line of STOCK INVEN the current line.
====> put 2 crime theft03469 GASKET AA0306 9432
32554 RATCHET AA0205 3762to the bottom of the CRIME THEFT file.
Press PF3 to quit the STOCK INVEN file (leaving it unchanged).
x crime theftto view the new contents of the CRIME THEFT file.
Mort, Mort, the plumber's son,
Stole a cow and away he run.
The cow got loose and scared a goose,
And Mort got put in the calaboose.
03469 GASKET AA0306 9432
32554 RATCHET AA0205 3762The lines you put in were inserted at the end.
At this point, you can delete the last two lines and enter FILE to return the file to its original form. Or, if you prefer, simply quit the file, leaving the additional lines you put in from STOCK INVEN.