"unroll" a matrix in awk: loop behaviour

This is a discussion on "unroll" a matrix in awk: loop behaviour within the Linux General forums, part of the Linux Forums category; How do I impliment looping behaviour in awk. I have a matrix in a text file that I need to &...


Go Back   Usenet Forums > Linux Forums > Linux General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-23-2008
Rahul
 
Posts: n/a
Default "unroll" a matrix in awk: loop behaviour

How do I impliment looping behaviour in awk.

I have a matrix in a text file that I need to "unroll"

1 2 3
4 5 6
7 8 9

0 0 1
1 0 2
2 0 3
0 1 4
1 1 5
2 1 6
etc.

The inner index is incremented only when a new line is encountered and the
outer index is incremented whenever a field seperator is incountered.

Any sugesstions?

--
Rahul
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:06 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0