improve extracting version from file

Change-Id: I1cd53173384521ba2446b7879262a10e0ecdb3b4