Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reformating problem making me lose hair.

Status
Not open for further replies.

isileth

Technical User
Jul 18, 2001
9
US
OK....driving me nuts here.
I have a file which is in s format somewhat akin to below:

12345 x y z
12345 a bb c dd
12345 m n o
45678 x y z
45678 a bb c dd
45678 m n o
34567 x y z
34567 a bb c dd
34567 m n o

The first column number (eg 12345) is like a process id and all the other variables are various other parameters associated with that process. So what I need to do is extract some of the various parameters associated with that process id, so I end up with something like:

12345 x bb y n m
45678 x bb y n m
34567 x bb y n m

Cheers all.

 
pls elaborate on "some of the various parameters" and define more precisely "so I end up with something like".

So far I don't see a pattern in what you HAVE and what you WANT to have.

vlad
 
Does this do what you want?
Code:
{
  x=$2
  y=$3
  getline
  bb = $3
  getline
  print $1 " " x " " bb " " y " " $3 " " $2
}
CaKiwi
 
pls elaborate on "some of the various parameters" and define more precisely "so I end up with something like".

So far I don't see a pattern in what you HAVE and what you WANT to have.

vlad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top