Code Comments
Programming Forum and web based access to our favorite programming groups.Hi all; I'm a total awk noob but i think awk is the right tool for what i need to do. I have lines of semi jumbled data ( there is a definite pattern to it, so this is why i figured awk might be good) that we need to move around a bit... ie: der@@f needs to read fred reta@@w needs to read water etc. I have zero clue how to start off with this. any help would be appreciated, or if awk is the wrong tool maybe can someone suggest the correct tool Cheers, Gary
Post Follow-up to this messageGary Hartl wrote:
> Hi all;
>
[ . . .]
>
> I have lines of semi jumbled data [ . . . ] that we need to move
> around a bit...
>
> ie:
> der@@f needs to read fred
> reta@@w needs to read water
>
> etc.
>
[ . . . ]
{
for (i = split($0, A, ""); i > 0; i--)
if (A[i] != "@") printf A[i]
print ""
}
--
Regards,
---Robert
Post Follow-up to this messageGary Hartl <the-smtpguy@cogeco.ca> wrote: > Hi all; > > I'm a total awk noob but i think awk is the right tool for what i need > to do. > > I have lines of semi jumbled data ( there is a definite pattern to it, > so this is why i figured awk might be good) that we need to move > around a bit... > > ie: > der@@f needs to read fred > reta@@w needs to read water > > etc. > > I have zero clue how to start off with this. > > any help would be appreciated, or if awk is the wrong tool maybe can > someone suggest the correct tool man tr man rev -- William Park, Open Geometry Consulting, <opengeometry@yahoo.ca> Linux solution for data management and processing.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.