i've a text file who contains this :
Hello 4
Bye 2
Toto 2
And i want to put the first string of each lines into MyArray1, and the integer into another one MyArray2.
I wrote this, but it doesn't work.
#!/bin/bash
countline=$(awk '{ print $1 }' test | wc -l)
for ((i=0; i<$countline ;i=i+1))
do
MyArray1[$i]=awk '{ print $1 }' test
done
for ((i=0; i<$countline ;i=i+1))
do
MyArray2[$i]=awk '{ print $2 }' test
done
Please help me.
countline=$(wc -l < test)