擅长:python、mysql、java
<p>试试这个:</p>
<pre><code>#!/usr/bin/env python
with open('f1') as fd:
for line in fd:
if line[0].isdigit():
print line.strip() + '\t\t'
else:
print line.strip()
</code></pre>
<p>输出(cortesy of <code>cat -t</code>):</p>
<pre><code>1^I^I
something ASDF 1,2,3,4,5
2^I^I
something2 ASDFG 1,2,5,8,9
etc
</code></pre>