Firstly, thank you for your kind and smart answer.
You are right data is not obvious, sorry for this, I am not familiar with html codes. My input data is exactly as you predicted:
1234 2321 0 45 1st
2122 sdsa 0 0 34
2313 dsad 43 2nd
1232 ffff 0 0 1st
3213 sadf 0 34
2133 dada 0 2nd
As it is seen, there is different number of spaces between columns. So /\s/ is not working as well as /\s+/ is not working, because some columns have whitespace characters. Also substr function does not work due to same reason. Substr does not see whitespace character and passes to next column. I hope told my problem clearly:) |