Skip to content

Commit

Permalink
Add example for how to discard header row from CSV (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed Feb 6, 2023
1 parent d2ff0e5 commit e3a9161
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions shell-friends.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,20 @@ Explanation
- Find all WordPress installations below `$WP_TOP_PATH` - must be run as root
- Display a progress bar while getting `blogname` of each installation
- Choose one installation from a nice menu and display `cd` command for it

**Discard header row from a CSV**

By default, `--format=csv` includes a header row:

```bash
$ wp user list --format=csv
ID,user_login,display_name,user_email,user_registered,roles
1,daniel,daniel,daniel@handbuilt.co,"2022-12-21 23:05:16",administrator
```

If you'd like to discard the header row, `tail` is pretty helpful:

```bash
$ wp user list --format=csv | tail -n +2
1,daniel,daniel,daniel@handbuilt.co,"2022-12-21 23:05:16",administrator
```

0 comments on commit e3a9161

Please sign in to comment.