Else if or not else if ? That is the question.
%%%%%
|
Have you printed all the values you are using? ie. all the values stored in each array?
|
%%%%%
|
Would appear you get different results to me:
Altered code: Code:
#!/usr/bin/awk -f Code:
$ ./test.awk file |
Note that the string fragment "; " contains two delimiters with a null string between them.
|
Thanks grail !
Thanks rknichols ! I didn't know it counted the empty string between ";" and " ". I just had to increment the indices of the second part by +1 and it works of course ! Thanks guys ! |
Actually the null is not an issue, but rather your split as it says split on either " " OR ";" so as there is more than one of these in the middle it caused an issue.
Simply try adding "+" to your regex as it needs to have one or more of those as a separator. Code:
split($2,c2,"[ ;]+") |
All times are GMT -5. The time now is 08:01 PM. |