Working with External Data and Commands in Vim

15 minutes
  • 3 Learning Objectives

About this Hands-on Lab

When working with Vim, we are not restricted to one single file, nor are we limited with our usage of Vim-only commands. We can run commands outside of Vim to modify Vim-based documents, or even manage other types of data using Vim. In this hands-on lab, we’ll work with sorting our Vim data through the use of the Linux `sort` command, and Vim functions such as `%`, `:w`, and `:r`.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Sort Data

Sort the data found in the newsignups.txt file.

Write Data to Files

Append the sorted users so that it will appear in the correct customer lists.

Create Full Customer List

Create a new file, userlist.txt, then pull in the needed data while still in Vim. Sort the list.

Additional Resources

You are providing sign up data for your manager. The data has already been pulled from the database and can be found in the data directory for cloud_user.

Sort the new signups found in home/cloud_user/data/newsignups.txt, then use this sorted text to add each chunk of users to the correct document (e.g., users with last names starting with A-G should be added to a-g.txt).

Additionally, create a document containing all users, both new and old, at userlist.txt, in the same data directory.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?