Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
number = "0123456789"
dim=split(number,arr,"")
for (i=1;i<=dim;i++) print i,":",arr[i]
awk '{dim=split($1,a,""); for (i=1;i<=dim;i++) print "arr" i "=" a[i]}' File
Then is clear : I did not understand you.Chris said:Your solution does work but does not assign to each array.
[blue]master #[/blue] cat File
0123456789 2006/06/06
hello world
[blue]master #[/blue] awk PHV.awk File
a1=0
a2=1
a3=2
a4=3
a5=4
a6=5
a7=6
a8=7
a9=8
a10=9
a1=h
a2=e
a3=l
a4=l
a5=o
a6=5
a7=6
a8=7
a9=8
a10=9
[blue]master #[/blue] awk Feherke.awk inputfile
arr1=0
arr2=1
arr3=2
arr4=3
arr5=4
arr6=5
arr7=6
arr8=7
arr9=8
arr10=9
arr1=h
arr2=e
arr3=l
arr4=l
arr5=o
man awk said:If FS is the null string, then each individual character becomes a separate field.
[gray](...)[/gray]
split(s, a [, r]) [gray](...)[/gray] Splitting behaves identically to field splitting, described above.