-
1
- #1
joeroe3380
MIS
HI group,
I have an output file with a single row and 24 fields seperated by spaces as shoen below:
000 156 317 441 605 800 156 316 441 605 800 999 00009 15659 31709 44119 60519 80029 15649 31699 44109 60509 80019 99999
i want to export (as an environment variable), each of the column, to be used for further processing.
for eg.export $var1 =000, $var2=156.........$var24=99999;
im trying to do something like beneath ..but without sucess..i'm new to unix..with just a couple of scripts written..
$ awk '{ for(i=1;i<=NF;i++) printf($i)}'< output.dat
000156317441605800156316441605800999000091565931709441196051980029156493169944109605098001999999$
$ export $1= awk '{printf($1)}'< output.dat
/bin/ksh: =: is not an identifier
$ export $1 | awk '{printf($1)}'< Joutput.dat
/bin/ksh: {printf($1)}: is not an identifier
plz provide some advice on how to go abt this.
Thanks in advance!!
I have an output file with a single row and 24 fields seperated by spaces as shoen below:
000 156 317 441 605 800 156 316 441 605 800 999 00009 15659 31709 44119 60519 80029 15649 31699 44109 60509 80019 99999
i want to export (as an environment variable), each of the column, to be used for further processing.
for eg.export $var1 =000, $var2=156.........$var24=99999;
im trying to do something like beneath ..but without sucess..i'm new to unix..with just a couple of scripts written..
$ awk '{ for(i=1;i<=NF;i++) printf($i)}'< output.dat
000156317441605800156316441605800999000091565931709441196051980029156493169944109605098001999999$
$ export $1= awk '{printf($1)}'< output.dat
/bin/ksh: =: is not an identifier
$ export $1 | awk '{printf($1)}'< Joutput.dat
/bin/ksh: {printf($1)}: is not an identifier
plz provide some advice on how to go abt this.
Thanks in advance!!