7

Perl to fill the lost value with previous value

view full story
linux-howto

http://ubuntuforums.org – For example, I have a text file consist of this number Code: (#ID #number) 1 0.062 742 -1.953 744 0.176 910 -2.000 913 0.164 The #ID is a sequence number. Can see that ID#2 to ID#741, ID#743, ID#745 to ID#909, ID#911 to ID#912 are not recorded. My wish output is Code: (#ID #number) 1 0.062 2 0.062 3 0.062 : 740 0.062 741 0.062 742 -1.953 743 -1.953 744 0.176 745 0.176 : 909 0.176 910 -2.000 911 -2.000 912 -2.000 913 0.164 The number of the unknown ID will repeat with the number of the previous recorded ID. Any idea? (Hardware)