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




Thread: split a string
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 02-09-2006
Abhishek Ghose Abhishek Ghose is offline
Registered User
  
 

Join Date: Sep 2005
Location: Chennai
Posts: 81
whether you need awk depends on what you want to after the assignment. If you want the variable outside the awk statement maybe using awk may not be very helpful. But, in situations , where you require processing data, this is seldom the case---you can do everything you want inside awk.
awk '{for(i=1;i<=NF;++i) { print "Field " i " is "$i} print ""}' file_name for example prints out all fields, in all lines in the file