I need to get store in a variable,say 'error' the value of the string 'fat hat chat'
In short,
echo $error should give the result
fat hat chat
Is this possible using awk?
Also, can this be split.For example, I have to store the value of the string (fat hat chat) in to two variables.Say, error1 and error2 (Given field width is predefined)
i.e
error1=fat ha
error2=h chat
Thanks for ur time Pankaj.
Can u please explain me what the 'a' and separator of the value stands for?
I searched in the man page .. But didnt understand any thing ..
i'm trying to split a string with *split*, but i can't.
for example:
in shell i do:
$ string='hi go bye'
$ then i try: awk 'split($string, strings, " ")'
(and a get the following)
$ awk: syntax error near line 1
$ awk: illegal statement near line 1
i've tried a lot of choices, with files and more, and i can't get what's going on.
where input.txt has only one line (comma deliminated) and I am trying to get the data into an array. For some reason, the array is empty. Can someone please tell me what is wrong with this statement?