Well this is what im doing, im writing a script that you pass 3 variables into. Filename, delimiter or "FS in AWK", and a string of columbs you want to keep 1,2,4,5... Just modifing a data file and rewriting with a different extension.
My problem atm is using awk to seperate the "columb String"
Input runme.sh filename.txt "|" 1,2,4,5
echo $3 | awk -F"," ' {for (i=1;i <=NF;i++) print $i }' |**well i want this redirected into an array..
**Output from this command gives me 1 2 4 5
I need to rebuild this into another awk command."like this"
to get my needed data
needs to be
awk -F"$dell" -v dell=$dell 'BEGIN{OFS= dell }{print $2,$4,""} <--dynamic
END{Print"for Kicks"}' $filename > newoutputfile.txt
**********************************************
OK found a solution myself this is in KSH
echo $time | awk -F"," '{ORS=" " }{OFS=""}{for(i=1;i <=NF;i++) print "$",$i }' | read ouput
set -A array $output
echo ${array[0]}
echo ${array[1]}
echo ${array[3]}