Replace blank values for string using sed

Hi everyone,

I was wondering how could from a file where each row is separated by tabulations, the row values where are in blank replace them by a string or value.

My file has this form:

26/01/09	13:45:00	0		0	
26/01/09	14:00:00	1495.601318	0	
26/01/09	14:15:00	1495.601318	0	
26/01/09	14:30:00	1495.601318	0	
26/01/09	14:45:00	1495.601318	0	
26/01/09	15:00:00	1495.601318	0	
26/01/09	15:15:00	1495.601318	0	
26/01/09	15:30:00	1495.601318	0	
26/01/09	15:45:00			0	
26/01/09	16:15:00	1105.571899	0	
26/01/09	16:30:00	1111.437012	0	

I've tried using sed command like this:

sed 's/[:blank:]+/-9999/g' input > output

but it doesn't work, could somebody tell me what I'm doing wrong,

thanks in advance.

Try...

sed 's/^$/-9999/' input > output

Try:

awk -F\t '{if($3=="")$3=string}1' OFS="\t" string=x file

tonet,
can you please put your input in code tags for a better readability?

If it's tab delimited, than it's something like this:

26/01/09	13:45:00	0		0 
26/01/09	14:00:00	1495.601318	0 
26/01/09	14:15:00	1495.601318	0 
26/01/09	15:45:00			0 
26/01/09	16:15:00	1105.571899	0 

Right?

Now you want it to be as following?

26/01/09	13:45:00	0		0 
26/01/09	14:00:00	1495.601318	0 
26/01/09	14:15:00	1495.601318	0 
26/01/09	15:45:00	-9999		0 
26/01/09	16:15:00	1105.571899	0 

Right?

sed 's/\t\t\t/\t-9999\t/g' input > output