#!/bin/bash
s='a chair x 0 y
a table x 0 y
a window x 0 y
a computer x 0 y'

awk '$2 == "window" && $4 == "0"{$4=111}1'  <<< "$s"