Now what I need to do is to print the numeric string whose length is 10 digits and then print the rest of the line. The output of the above sample should be:
i thought about the same solution in solaris but below part does not work in solaris, is there any good way to do it in solaris? maybe Lenght function? or no choice rather than using 10 times [0-9]
Ok Scott thanks a lot for this usefull knowledge, Im going to use /usr/xpg4/bin/awk for guaranteed solutions anymore. Besides you right length will work there for fields with 10 ALNUMs, not only digits.
Thanks Scottn..... the script worked on my system with /usr/xpg4/bin/awk
It would be really nice of you if you could please explain me the way this awk is working specially the 1 in the end, whats its purpose ?
1 at the end of the code means the whole line, its also represented by $0.
code searchs for the 10 digits field by checking each field of each line of the file. If 10 digits of field is found then first column is rearranged with this part
$1=$I FS $1
namely it (10 digits field) is placed before first field as you wanted.