Here's an extemely lazy way of doing what you're talking about.
//Static keeps scope within the file you're working in.
static const char *dir_letters = "abcdefghijklmnopqrstuvwxyz";
void do_whatever(CHAR_DATA *ch, char *argument)
{
char letter;
int i;
//adjust directory as appropriate.
system ("rm -f ../players.txt");
for (i = 0; i < 26; i++)
{
letter = dir_letters[i];
system ("head ../players/%c/* >> ../../players.txt", letter);
//or, if you cap your dir names, you'd do:
system ("head ../players/%c/* >> ../../players.txt", toupper(letter));
}
<parse players.txt for output>
}
The only thing you'd have to do now is parse your result. I'd recommend
rewriting how you save your pfiles a little bit so you only have to do, say,
system ("head -n 6 ../players/%c/* >> ../../players.txt", letter); --
That is, the first 6 lines. Makes parsing faster.
There are, of course, quicker and more efficient methods: Grep would make a
great choice, you could search for 'Levl' in the pfile and use -B and -A for
lines before and after the context as well as other nifty things. See man
grep.
-- Jeremy
----- Original Message -----
From: "Todd Rickard" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[email protected]>
Sent: Sunday, February 22, 2004 11:10 PM
Subject: Re: Transending Folders
> The command, basicly, will print out to the screen everyname within the
> player folder, and in this case, it prints the players name, race, clan,
> level, and how long ago they were last on. It worked fine when all the
> players were just "thrown" into the player folder.
>
> But now with each player going into their respective folder inital. the
> command is now only showing me the name of the folders. and I've so far
> been unable to get the command to traverse all the folders for the
> information.
>
> >From: "Michael Barton" <[EMAIL PROTECTED]>
> >To: <[email protected]>
> >Subject: Re: Transending Folders
> >Date: Sun, 22 Feb 2004 22:37:57 -0600
> >
> >I don't understand exactly what you are saying. Perhaps you can better
> >explain what
> >you mean by "pull up everyone in our player file from within the game" and
> >"pull up
> >each folder and printing it into the screen".
> >Are you looking for a specific pfile or traversing them all?
> >
> >----- Original Message -----
> >From: "Todd Rickard" <[EMAIL PROTECTED]>
> >To: <[email protected]>
> >Sent: Sunday, February 22, 2004 10:10 PM
> >Subject: Transending Folders
> >
> >
> > > Greetings and Salutations;
> > >
> > > I've been useing a mud command that allows me to pull up everyone in our
> > > player file from within the game. Now that once again we have switched
> > > bases, our player folder is set up so that every name will go into their
> > > respective "inital" folder.
> > >
> > > I.E. All names that begin with "a" go into the folder "A" etc...
> > >
> > > I've tried a couple different ideas to try and get the command to go
> >into
> > > each folder and pull the info out that we need, but the best I can do so
> >far
> > > is haveing it pull up each folder and printing it to the screen, which
> >does
> > > me no good.
> > >
> > > Any help or ideas are and will be appreaciated.
> > >
> > > todd
> > >
> > > Aim:jtrpdx
> > > Msn: [EMAIL PROTECTED]
> > >
> > > _________________________________________________________________
> > > Take off on a romantic weekend or a family adventure to these great U.S.
> > > locations. http://special.msn.com/local/hotdestinations.armx
> > >
> > >
> > > --
> > > ROM mailing list
> > > [email protected]
> > > http://www.rom.org/cgi-bin/mailman/listinfo/rom
> >
> >
> >--
> >ROM mailing list
> >[email protected]
> >http://www.rom.org/cgi-bin/mailman/listinfo/rom
>
> _________________________________________________________________
> Click, drag and drop. My MSN is the simple way to design your homepage.
> http://click.atdmt.com/AVE/go/onm00200364ave/direct/01/
>
>
> --
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom