I have a large file named CHECKME which is tab delimited. There are 8 columns in each row. Column 4 is integers.
By using Perl or Python, is it possible to verify that each row in CHECKME has 8 columns and that column 4 is an integer?
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.
In Python:
I assume that by “column no. 4” you mean the 4th one, hence the
[3]since Python (like most computer languages) indices from 0.Here I’m just returning a boolean result, but I split up the code so it’s easy to give good diagnostics about what line is wrong, and how, if you so desire.