info: merge jsoninfo and txtinfo common code