This is not really a Perl problem. Your problem is to define exactly what your input really looks like, in order to figure out whether the third column exists or is missing. In other words, the problem is to define the input format. Once we know that, writing the Perl program that can do what you need is probably very easy.
As Cristoforo said, perhaps you have fixed length fields, in which case pack or substr are problably likely candidates for the functions you want to use. If you have tab separated fields, split is more likely to solve your problem. Or, maybe, the solution is in a regular expression match. It could also be that splitting on a single space (rather than multiple spaces with /\s+/ , as suggested by 0day, is simply the solution. But we can't figure out exactly what your input file really looks like from your post, because it has probably been reformatted in your post. At the very least, please supply your input file within code tags, we will be more likely to understand your input file format.
It would be even better to have a link to a sample of your input file. That would be better, because if you copy and paste a section of the file, it is quite possible that tabs get copied as groups of spaces, so that it might be difficult to undertand the real format or the original file.
In reply to Re: To split with spaces
by Laurent_R
in thread To split with spaces
by gorkemsarikaya
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |