getting segment after reading from file