<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: script for inserting form feeds into file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-inserting-form-feeds-into-file/m-p/2644517#M722761</link>
    <description>if you have a c compiler on your system, you can use this in a pipeline:&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt; * Copy stdin to stdout, insert formfeed every 66 lines.&lt;BR /&gt; */&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;&lt;BR /&gt;main() {&lt;BR /&gt; int line = 0;&lt;BR /&gt; int c;&lt;BR /&gt;&lt;BR /&gt; if ( (c = getchar()) == EOF)&lt;BR /&gt;   return;&lt;BR /&gt;&lt;BR /&gt; for (;;) {&lt;BR /&gt;  if (c == '\n')&lt;BR /&gt;    line++;&lt;BR /&gt;  putchar(c);&lt;BR /&gt;&lt;BR /&gt;  /*&lt;BR /&gt;   * An odd place to leave the loop, but it keeps a final&lt;BR /&gt;   * formfeed from being generated when the last page&lt;BR /&gt;   * has exactly 66 lines.&lt;BR /&gt;   */&lt;BR /&gt;  if ( (c = getchar()) == EOF)&lt;BR /&gt;    break;&lt;BR /&gt;&lt;BR /&gt;  if (line &amp;gt;= 66) {&lt;BR /&gt;   putchar('\f');&lt;BR /&gt;   line = 0;&lt;BR /&gt;  }&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;mark&lt;/STDIO.H&gt;</description>
    <pubDate>Mon, 14 Jan 2002 17:59:32 GMT</pubDate>
    <dc:creator>Mark Greene_1</dc:creator>
    <dc:date>2002-01-14T17:59:32Z</dc:date>
    <item>
      <title>script for inserting form feeds into file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-inserting-form-feeds-into-file/m-p/2644516#M722760</link>
      <description />
      <pubDate>Mon, 14 Jan 2002 17:52:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-inserting-form-feeds-into-file/m-p/2644516#M722760</guid>
      <dc:creator>james gould</dc:creator>
      <dc:date>2002-01-14T17:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: script for inserting form feeds into file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-inserting-form-feeds-into-file/m-p/2644517#M722761</link>
      <description>if you have a c compiler on your system, you can use this in a pipeline:&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt; * Copy stdin to stdout, insert formfeed every 66 lines.&lt;BR /&gt; */&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;&lt;BR /&gt;main() {&lt;BR /&gt; int line = 0;&lt;BR /&gt; int c;&lt;BR /&gt;&lt;BR /&gt; if ( (c = getchar()) == EOF)&lt;BR /&gt;   return;&lt;BR /&gt;&lt;BR /&gt; for (;;) {&lt;BR /&gt;  if (c == '\n')&lt;BR /&gt;    line++;&lt;BR /&gt;  putchar(c);&lt;BR /&gt;&lt;BR /&gt;  /*&lt;BR /&gt;   * An odd place to leave the loop, but it keeps a final&lt;BR /&gt;   * formfeed from being generated when the last page&lt;BR /&gt;   * has exactly 66 lines.&lt;BR /&gt;   */&lt;BR /&gt;  if ( (c = getchar()) == EOF)&lt;BR /&gt;    break;&lt;BR /&gt;&lt;BR /&gt;  if (line &amp;gt;= 66) {&lt;BR /&gt;   putchar('\f');&lt;BR /&gt;   line = 0;&lt;BR /&gt;  }&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;mark&lt;/STDIO.H&gt;</description>
      <pubDate>Mon, 14 Jan 2002 17:59:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-inserting-form-feeds-into-file/m-p/2644517#M722761</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2002-01-14T17:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: script for inserting form feeds into file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-inserting-form-feeds-into-file/m-p/2644518#M722762</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I would choose a perl-version:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;while (&lt;STDIN&gt;)&lt;BR /&gt;{&lt;BR /&gt;  chop $_;&lt;BR /&gt;  print "$_\r\n";&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;It should be faster then C because of the very fast string-routines in perl.&lt;BR /&gt;&lt;BR /&gt;Frank&lt;BR /&gt;&lt;/STDIN&gt;</description>
      <pubDate>Tue, 15 Jan 2002 16:25:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-inserting-form-feeds-into-file/m-p/2644518#M722762</guid>
      <dc:creator>Frank Gilsdorf</dc:creator>
      <dc:date>2002-01-15T16:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: script for inserting form feeds into file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-inserting-form-feeds-into-file/m-p/2644519#M722763</link>
      <description>Same question is in thread:&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xadd528e43106d6118ff40090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xadd528e43106d6118ff40090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If you prefer a script, there's an answer there.&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Tue, 15 Jan 2002 16:47:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-inserting-form-feeds-into-file/m-p/2644519#M722763</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-01-15T16:47:26Z</dc:date>
    </item>
  </channel>
</rss>

