I am reading a file using the following code:
displayLine(){
echo $line
}
filename="SampleFile"
while read line
do
displayLine $line
done < "$filename"
The format of the file that I am getting after using the script is this:
ID EVENT OK NOK
101 ABC1123 ok nok
101 ABC1223 ok
101 ABC1323 ok nok
101 ABC1423 ok nok
But the actual format of the file is like this:
ID EVENT OK NOK
101 ABC1123 ok nok
101 ABC1223 ok
101 ABC1323 ok nok
101 ABC1423 ok nok
My script is somehow trimming the extra spaces between the words. However, I want the actual format of the file.
Could anyone tell me how to achieve that?
Thanks!!