The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 01-05-2009
npatwardhan npatwardhan is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 135
storing records in awk array

hi i have a file as follows:

Code:
1
2
3
4
5
6
i want to store all these numbers in an array using awk.. so far i have:

Code:
awk '{for(i=1;i<=NR;i++) {a[i]=$1}} END {for(i=1;i<=NR;i++) {printf("%1.11f",a[i])}}' 1.csv > test
however, i am getting all values as zero in the "test" file..
appreciate any help.