appending previous data.

I have on file abc.txt

abc.txt:

20090807

Now I want to delete empty lines which has tap/whit spaces from abc.txt .and store the date value in the file into variable.some processs will update the this file with some date . if the process updtes thiis file with empty string , write the value captured in the variable.

Thing is I want to have date value in the file instead empty string. If today values not there, yesterday value should be there

Can u put some sample data ....

A file named abc.txt being updated with date value by one process.

Say , today it s updating the file with value

01-09-2009

Fine. Tomorrow the process will override the file with tomorrow date (02-09-2009) .Insome case the process will overriding the file with empty string.

So I want script to check whether the file has value or empty string. If some value means leave it as it is . if empty string means , the script should override the file with previous dae value (01-09-2009). and i scrit should delete if any whitspace or tab or empty newline charectedr from the file

Thanks in advance

Gopal,

Ideally your data file should not have any white spaces.If your data file has empty string it should take the previous record otherwise the latest record.

So we can remove an white space which it looks a good solution for me and here is a simple perl one liner

perl -ne 'print if /\S/' <input file>;

Let me know if u r looking some thing more