This is one way to make it:
$ sed -r 's/^([0-9]{10})[^.]*/\1/' file
0123456789. foo....
1234566789. bar...
0912309299. foobar..
Or also (to get 10 first chars in general, no matter if they are a number or not):
sed -r 's/^(.{10})[^.]*/\1/'
Explanation
-r
allow extended regex.sed 's/find/replace/'
is the basic substitution: replacefind
withreplace
once. In this case, we use the following:^([0-9]{10})[^.]*
catch first 10 digits. Also, catch all characters up to a dot.
.\1
print back the first block.
This is a schema of the substitution:
0123456789 foo. foo....
1234566789 bar. bar...
0912309299 foobar. foobar..
^^^^^^^^^^ ^^^^^^^^^^
| ^^^^^^^ |
| | |
^([0-9]{10}) [^.]* |
| |
| |----
^^^^^^^^^^-------------
0123456789. foo....
1234566789. bar...
0912309299. foobar..