I have a Unix command that outputs file contents with each line prefixed by the respective file name:

```
C:\lessgov.txt | WHY LESS GOVERNMENT IS BETTER GOVERNMENT
C:\lessgov.txt | A rant...

C:\todos.txt | TODOS
C:\todos.txt | buy bread
C:\todos.txt | shine shoes

```

What precise command can I use to remove everything after and including the vertical bar? (I am thinking `sed` but I've no real idea how to use it if I'm right.)

```
C:\lessgov.txt
C:\lessgov.txt

C:\todos.txt
C:\todos.txt
C:\todos.txt

```

I am actually using Windows but I have a port of most of the Unix commands at my disposal.

EDIT:

This worked.

```
cmd> search $dirs | tail -n5 | concat --prefix | grep CPCMS | sed "s/|.*//"

```

`search` and `concat` are custom.