I want to cut the characters n-N of a line, but ONLY if the line begins with certain characters, otherwise I want to print the whole line.

Simplified File example:

```
John
123456987123
Mark
123546792019

```

I want to make two new files, one with the FIRST 6 numbers and the other with the last 6 numbers, but still containing the headers, so

```
John
123456
Mark
123546

```

---

```
John
987123
Mark
792019

```

Can I tell grep cut to only cut if the string matches, but to otherwise give the whole file? What sort of awk command can cut lines if a condition is met or otherwise print the whole line?

Thanks