I have files like this

```
$ cat trapetz
x = 0:0.0001:7pi
plot(x, sin(x).*cos(x))
Area = trapz(x, sin(x).*cos(x))
$ cat simpson
f = inline(sin(x).*cos(x));
Area2 = quad(f, 0, 7pi, 1e-16)
```

I want something like this

```
$ cat -b -t MISSING? trapetz simpson
traapetz
1 x = 0:0.0001:7pi
2 plot(x, sin(x).*cos(x))
3 Area = trapz(x, sin(x).*cos(x))
simpson
1 f = inline(sin(x).*cos(x));
2 Area2 = quad(f, 0, 7pi, 1e-16)
```

or even better if some easy way to add wc there:

```
$ find |tee |...|wc... I feel now reinventing the wheel, there must be some ready...
traapetz: xyz chars
1 x = 0:0.0001:7pi
2 plot(x, sin(x).*cos(x))
3 Area = trapz(x, sin(x).*cos(x))
simpson: zyx chars
1 f = inline(sin(x).*cos(x));
2 Area2 = quad(f, 0, 7pi, 1e-16)
```

but I get

```
$ cat -b -t trapetz simpson
1 x = 0:0.0001:7pi
2 plot(x, sin(x).*cos(x))
3 Area = trapz(x, sin(x).*cos(x))
4 f = inline(sin(x).*cos(x));
5 Area2 = quad(f, 0, 7pi, 1e-16)
```

Not really cat needed but some easy tool to share and show code snippets like the above, not pastebin. I want some standard command line thing. I am trying to create easy puzzle -pasting for codegolf.se so people could reproduce things easily…

## Best Answer

A very rough awk implementation:

Execute

`awk -f AWKFILE trapetz simpson`

to get: