Page 1 of 1

Need help badly here

Posted: 24 Mar 2012 06:47
by renzlo
Hi All,

I am having a hard time figuring this out, I hope someone can help me.

This is the content of my text file:

Code: Select all

<?page i?>
<para id="fm-P0"><figure id="F1"><graphic picfile="I9781285011929_0001"/></figure></para>
<?page ii?>
<?page iii?>
<?page iv?>
<?page v?>
<?page vi?>
<?page vii?>
<?page viii?>
<?page ix?>
<?page x?>
<?page xi?>
<?page xii?>
<?page xiii?>
<?page xiv?>
<?page xv?>
<?page xvi?>
<?page xvii?>
<?page xviii?>
<para id="fm-P53">&nbsp;&nbsp;&nbsp;There is only one reason for this book, and that is to help you merge the differing disciplines of character design, the ever-expanding digital universe, and good old-fashioned artistic skill and creativity. This book has been written so that anyone from the seasoned professional to the aspiring artist will find something of use. Professionals will possibly find<?page xix?> ideas for ways of doing things that had never occurred to them before. Aspiring artists will find valuable information on basic artistic principles and specific techniques for designing a character. If you are neither a professional nor an aspiring artist, I hope that there is some art you will find intriguing to look at.</para>
<?page xx?>
<?page xxi?>
<?page xxii?>
<?page 1?>
<?page 2?>
<?page 3?>
<graphic picfile="I9781285011929_0002"/></figure>
<?page 4?>
<graphic picfile="I9781285011929_0003"/></figure>
<?page 5?>
<graphic picfile="I9781285011929_0004"/></figure>
<?page 6?>
<?page 7?>
<graphic picfile="I9781285011929_0005"/></figure>
<graphic picfile="I9781285011929_0006"/></figure>
<?page 8?>
<para id="ch1-P27">When designing for video games, the polygon count for a character is still an important issue. Larger characters may need more polygons. They may need much more<?page 9?> detailed texture maps, too. A model of an insect character would be approached differently than one of an elephant.</para>
<?page 10?>
<?page 11?>
<?page 12?>
<?page 13?>
<figure id="F7"><graphic picfile="I9781285011929_0007"/></figure>
<?page 14?>
<?page 15?>
<?page 16?>
<?page 17?>
<?page 18?>
<?page 19?>
<figure id="F8"><graphic picfile="I9781285011929_0008"/></figure>
<?page 20?>
<item><label><b>2.</b></label><para id="ch3-P8"><b>Closely observe the people around you every day.</b> If you do this, you will begin to notice special qualities that you didn&apos;t see before. As your mind begins thinking about your basic character idea, consider applying to your character the individual qualities, traits, physical appearance, quirks, habits, and faults of your friends. Don&apos;t just limit yourself to friends. Include the larger circle of your acquaintances as well as celebrities, politicians, sports<?page 21?> stars, and anyone in the public eye. If you are designing a villain, why not base the character on people that you just do not like? You can also look at fictional characters, but watching them is not as much fun as observing real people. Remember that a fictional character is already someone else&apos;s vision and as such is nothing more than a shallow representation of a personality, whereas real people have much more depth.</para></item>
<graphic picfile="I9781285011929_0009"/>
<?page 22?>
<para id="ch3-P25">Fantasize about the character that you need to design. Fantasizing goes hand in hand with both brainstorming and daydreaming. Fantasizing is more an individual activity where you would imagine &ldquo;what if&rdquo;-type situations about your character, whereas<?page 23?> brainstorming is best in a group setting, as we have seen. When fantasizing, you will want to get out of the everyday modes of thought and see how far out you can take your ideas. &ldquo;What if?&rdquo; is the biggest question to ask yourself when you fantasize.</para>
<?page 24?>
<graphic picfile="I9781285011929_0010"/>
<?page 25?>
<graphic picfile="I9781285011929_0011"/>
<?page 26?>
<graphic picfile="I9781285011929_0012"/>
<graphic picfile="I9781285011929_0013"/>
<?page 27?>
<graphic picfile="I9781285011929_0014"/>
<graphic picfile="I9781285011929_0015"/>
<para id="ch3-P38">Exaggeration, which is an integral part of caricature, is fairly self-explanatory. Take your character idea and exaggerate some portion of it. The exaggeration can either be extreme or subtle, depending on your intention. Be careful that you do not exaggerate everything within the character. After all, exaggeration is based on the difference<?page 28?> between things that we consider the norm and things that are not the norm. <xref pointer="F16">Figure 3.8</xref> shows an already exaggerated face that has been exaggerated even more.</para>
<graphic picfile="I9781285011929_0016"/>
<para id="ch3-P41">So every character that you draw has the facial expression of a zombie. No wonder the characters lack life. Every character needs to have expression, and the majority of that expression is found in the face and body language. A good way to practice drawing facial expressions is to revert to the most basic elements that drive an expression:<?page 29?> the eyes, nose, and mouth. As quickly as possible, draw a series of expressions using only lines for the facial features. Some of them will be garbage, but some will look like something. Take the ones that look like something and develop them further.</para>
<?page 30?>
<?page 31?>
<?page 32?>
<?page 33?>
<graphic picfile="I9781285011929_0017"/>


Now, I want to count the page that contains a "graphic picfile" so in the example above the count should be 16.
To make it clear, here's the manually converted valid pages of the sample above.

Code: Select all

<?page i?>
<para id="fm-P0"><figure id="F1"><graphic picfile="I9781285011929_0001"/></figure></para>
<?page xviii?>
<para id="fm-P53">&nbsp;&nbsp;&nbsp;There is only one reason for this book, and that is to help you merge the differing disciplines of character design, the ever-expanding digital universe, and good old-fashioned artistic skill and creativity. This book has been written so that anyone from the seasoned professional to the aspiring artist will find something of use. Professionals will possibly find<?page xix?> ideas for ways of doing things that had never occurred to them before. Aspiring artists will find valuable information on basic artistic principles and specific techniques for designing a character. If you are neither a professional nor an aspiring artist, I hope that there is some art you will find intriguing to look at.</para>
<?page 3?>
<graphic picfile="I9781285011929_0002"/></figure>
<?page 4?>
<graphic picfile="I9781285011929_0003"/></figure>
<?page 5?>
<graphic picfile="I9781285011929_0004"/></figure>
<?page 7?>
<graphic picfile="I9781285011929_0005"/></figure>
<graphic picfile="I9781285011929_0006"/></figure>
<?page 8?>
<para id="ch1-P27">When designing for video games, the polygon count for a character is still an important issue. Larger characters may need more polygons. They may need much more<?page 9?> detailed texture maps, too. A model of an insect character would be approached differently than one of an elephant.</para>
<?page 13?>
<figure id="F7"><graphic picfile="I9781285011929_0007"/></figure>
<?page 19?>
<figure id="F8"><graphic picfile="I9781285011929_0008"/></figure>
<?page 20?>
<item><label><b>2.</b></label><para id="ch3-P8"><b>Closely observe the people around you every day.</b> If you do this, you will begin to notice special qualities that you didn&apos;t see before. As your mind begins thinking about your basic character idea, consider applying to your character the individual qualities, traits, physical appearance, quirks, habits, and faults of your friends. Don&apos;t just limit yourself to friends. Include the larger circle of your acquaintances as well as celebrities, politicians, sports<?page 21?> stars, and anyone in the public eye. If you are designing a villain, why not base the character on people that you just do not like? You can also look at fictional characters, but watching them is not as much fun as observing real people. Remember that a fictional character is already someone else&apos;s vision and as such is nothing more than a shallow representation of a personality, whereas real people have much more depth.</para></item>
<graphic picfile="I9781285011929_0009"/>
<?page 22?>
<para id="ch3-P25">Fantasize about the character that you need to design. Fantasizing goes hand in hand with both brainstorming and daydreaming. Fantasizing is more an individual activity where you would imagine &ldquo;what if&rdquo;-type situations about your character, whereas<?page 23?> brainstorming is best in a group setting, as we have seen. When fantasizing, you will want to get out of the everyday modes of thought and see how far out you can take your ideas. &ldquo;What if?&rdquo; is the biggest question to ask yourself when you fantasize.</para>
<?page 24?>
<graphic picfile="I9781285011929_0010"/>
<?page 25?>
<graphic picfile="I9781285011929_0011"/>
<?page 26?>
<graphic picfile="I9781285011929_0012"/>
<graphic picfile="I9781285011929_0013"/>
<?page 27?>
<graphic picfile="I9781285011929_0014"/>
<graphic picfile="I9781285011929_0015"/>
<para id="ch3-P38">Exaggeration, which is an integral part of caricature, is fairly self-explanatory. Take your character idea and exaggerate some portion of it. The exaggeration can either be extreme or subtle, depending on your intention. Be careful that you do not exaggerate everything within the character. After all, exaggeration is based on the difference<?page 28?> between things that we consider the norm and things that are not the norm. <xref pointer="F16">Figure 3.8</xref> shows an already exaggerated face that has been exaggerated even more.</para>
<graphic picfile="I9781285011929_0016"/>
<para id="ch3-P41">So every character that you draw has the facial expression of a zombie. No wonder the characters lack life. Every character needs to have expression, and the majority of that expression is found in the face and body language. A good way to practice drawing facial expressions is to revert to the most basic elements that drive an expression:<?page 29?> the eyes, nose, and mouth. As quickly as possible, draw a series of expressions using only lines for the facial features. Some of them will be garbage, but some will look like something. Take the ones that look like something and develop them further.</para>
<?page 33?>
<graphic picfile="I9781285011929_0017"/>


Thanks in advance.

Re: Need help badly here

Posted: 24 Mar 2012 07:44
by foxidrive
16? I get 17.


Code: Select all

d:\>dir f* /b
file.txt

d:\>find /c "<graphic picfile=" <file.txt
17

Re: Need help badly here

Posted: 24 Mar 2012 11:58
by dbenham
The problem is he wants the number of pages that contain at least one picture (16), not the number of pictures (17).

I can't tell if he wants just the count, or if he wants the content of the pages that contain a picture (or both).

Either way, I don't think the problem can be solved with FINDSTR alone. Getting the count only could be done fairly easily using a FOR /F loop. But if he needs to extract the page content, then each page should probably be buffered in a temp file since a page could easily exceed the 8k variable size limit.

Dave Benham

Re: Need help badly here

Posted: 24 Mar 2012 13:30
by foxidrive
dbenham wrote:The problem is he wants the number of pages that contain at least one picture (16), not the number of pictures (17).

I can't tell if he wants just the count, or if he wants the content of the pages that contain a picture (or both).


I can't tell how the samples correlate, given the typed description of the task.

He wants to count 'graphic pic' but there are passages of text, but not all 'graphic pic' has a passage of text.

@renzlo:
Can you give some more info?