[kwlug-disc] bash question tab separated values

Richard Weait richard at weait.com
Fri Nov 6 08:07:16 EST 2009


On Thu, Nov 5, 2009 at 11:37 PM, Robert P. J. Day <rpjday at crashcourse.ca> wrote:
>  can't you just set the internal field separator before reading in
> the file in a bash loop:
>
>  IFS="<TAB>"
>  while read v1 v2 v3 ...etc... v10 ; do
>    ... whatever with v1 v2 v3 ...
>  done < inputfile
>
>  the proper way to set the IFS would be (from experience), typing the
> first quote, then a ^v, followed by pressing the TAB key, then
> finishing off with the closing quote.  the ^v means "take the next
> character absolutely literally."
>
>  i just tested that and it seems to work.

Thank you!




More information about the kwlug-disc mailing list