The UNIX and Linux Forums  


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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
reading reading data from webpage phani_sree High Level Programming 3 11-01-2007 01:28 PM
Need to get the first column of data bobk544 Shell Programming and Scripting 3 08-04-2007 05:35 PM
How to write data in column c0384 Shell Programming and Scripting 8 07-28-2007 06:18 PM
Using loop reading a file,retrieving data from data base. Sonu4lov Shell Programming and Scripting 1 01-19-2007 03:38 AM
Move data from Column to Row danhodges99 Shell Programming and Scripting 4 05-19-2003 11:23 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-18-2005
FarhanNaseer FarhanNaseer is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 1
Column data reading

Experts I am new to UNIX shell programming ( or scripting). My problem is that
I have an ASCII file in which column wise data is present, the columns are seperated by spaces. I want to read each columns data and store it in arrays, next I will be using the arrays to perform some numerical operations.
Could anybody help me on this.
Thanks in advance.
  #2 (permalink)  
Old 09-19-2005
RishiPahuja's Avatar
RishiPahuja RishiPahuja is offline
Registered User
  
 

Join Date: Apr 2005
Location: Bangalore, India
Posts: 203
Thumbs up

Hey Farhan,
Try this, this should help you to begin.


Code:
> more farhan                                          
1 R
4 X
3 F
2 J
8 T
> awk 'BEGIN {sum=0} {sum+=$1}  END {print "sum=" sum}' farhan
sum=18


rishi
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:06 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0