let's call
x = number of hours worked by Kyle in his old job.
y = number of hours worked by Kyle in his new job.
Writing the system of equations:
x + y = 54
5x + 7y = 338
Solving the system of equations:
5 (54-y) + 7y = 338
270-5y + 7y = 338
2y = 338-270
y = 68/2 = 34
Therefore, Kyle worked 34 hours in his new job.