Warp to keys plugin may help. Apply to null, delete Y-position data.
If you mean Warp Stabilize the answer is no, the entire shot will be smoothed out. This may remove enough of the swaying but it will not lock the shot in X.
If you mean Stabilize motion then the answer is yes. You apply stabilization by tracking something that stays in the frame and then you apply the stabilization to the clip. Just make sure that you pick a big enough area of detail to get a good solid track and make sure that detail stays in the entire shot.
You then add a null to the comp and tie the position property of the null to the Anchor Point of the stabilized footage with an expression. For example if the footage layer was named stabilized then the expression for position would be:
If you move the CTI to the first frame of the stabilized footage and make the null the Parent the motion will be put back in the clip and you will still have the stabilizing data to use.
To stabilize only in X all you have to do is break down the expression into an array and assign a value or read the value of x. The modified expression would look like this:
a = thisComp.layer("stabilized").transform.anchorPoint;
x = value;
y = a;
You could also just type in a value for y. That's all there is to it. You should note that you'll have to nest this comp in your main comp and scale it up because stabilizing is going to reveal some edges as the camera moves. If the camera is also rotating you'll have to stabilize rotation and possibly scale. Rotation can be put back in the camera move by simply adding a minus sign to the expression so a rotation to fix rotation would look like this:
But if you wanted to stop the rotation you would not link the nulls rotation to the stabilized layer's rotation.
Scale is a lot more complicated and from your shot description it doesn't look like you'll need that.
x = value;
y = value;
tx = thisComp.layer("stabilized").transform.scale;
ty = thisComp.layer("stabilized").transform.scale;
nx = x/tx*x;
ny = y/ty*y;
You can use the same trick to hold scale in either X or Y but I don't think you need to go that far. This is what a completed comp would look like. Note the big black area on the left. I've stopped all left and right movement in the shot while returning the original vertical camera movement.
When you get things setup correctly I suggest that you save the null layer's properties and expressions as an Animation Preset. I have more than 200 or them that I've developed and collected over the years and they save me hours every day.