How do I use the split function to split by “\.”?
For example, first consider splitting by ::
echo "03:26:12" | awk '{split($0,a,":"); print a[3] a[2] a[1]}'
Which produces this output:
122603
But if the incoming string is instead:
echo "03\.26\.12" | awk '{split($0,a,???); print a[3] a[2] a[1]}'
With desired output:
122603
What should the ??? be?
You must escape both characters:
Result: