I have a text file and I want to remove the last comma , from the second last line if exist.
a, b, c, d,
m, n, p,
x, y, z,
);
The comma after z needs be removed only.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Give this a try:
It removes the comma from the end of the next-to-last line. This assumes that there is nothing after the last line you show.
If you need to key on the contents of that line instead, then this should work: