splitting lists into sublists
You can use ReplaceAll
with an appropriate pattern in such cases
{{a, X, b}, {c, d, e, X, f}, {h, j, X}} /. {begin___, X, end___} :> {begin}
Note the use of named patterns of the BlankNullSequence
variety that can stand for any sequence of zero or more expressions
lis = {{a, X, b}, {c, d, e, X, f}, {h, j, X}};
TakeWhile[#, # =!= X &] & /@ lis
{{a},{c,d,e},{h,j}}
From comment by Mr. J.M
First[Split[#, #2 =!= X &]] & /@ lis
Using Position
lis = {{a, X, b}, {c, d, e, X, f}, {h, j, X}};
#[[1 ;; Position[#, X][[1, 1]] - 1]] & /@ lis
(* {{a}, {c, d, e}, {h, j}} *)