OT: help with text file?

Matthew Flaschen matthew.flaschen at gatech.edu
Sun Jan 18 01:36:31 UTC 2009


Dave Stevens wrote:
> Hi,
> 
> I have a sequence of lines of ASCII text of varying length, each of which ends 
> with an integer. Anyone have a quick and dirty way of getting these lines 
> copied to a new file with only the last number on each line of the new file?

How about:

grep -o -E [[:digit:]]+$ foo.txt > new_file.txt

Matt Flaschen




More information about the fedora-list mailing list