<?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: Vi question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929695#M287202</link>
    <description>Hunki,&lt;BR /&gt;&lt;BR /&gt;What criteria are you using to decide which lines should be joined together?&lt;BR /&gt;&lt;BR /&gt;PCS</description>
    <pubDate>Mon, 22 Jan 2007 09:13:37 GMT</pubDate>
    <dc:creator>spex</dc:creator>
    <dc:date>2007-01-22T09:13:37Z</dc:date>
    <item>
      <title>Vi question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929690#M287197</link>
      <description>Situation :&lt;BR /&gt;-------------&lt;BR /&gt;While editing in vi I most often face a situation when I have to do a shift-J to join lines . &lt;BR /&gt;&lt;BR /&gt;Question:&lt;BR /&gt;----------&lt;BR /&gt;How can I determine which lines need to be joined instead of scrolling and looking over these lines within a long file.  &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 20 Jan 2007 20:06:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929690#M287197</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2007-01-20T20:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Vi question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929691#M287198</link>
      <description>Since you haven't defined what conditions define the need to join lines then other than using "The Force" how is anyone supposed to answer this question?</description>
      <pubDate>Sat, 20 Jan 2007 20:49:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929691#M287198</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-01-20T20:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Vi question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929692#M287199</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;If there is some criteria for joining lines, you may be able to write a shell script that reads from the original file and creates a second.&lt;BR /&gt;&lt;BR /&gt;There must be some data that a machine can identify, otherwise your current methodology is all you have.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Sun, 21 Jan 2007 02:41:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929692#M287199</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-01-21T02:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Vi question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929693#M287200</link>
      <description>The real question is - how did the lines get disjoined in the first place?&lt;BR /&gt;&lt;BR /&gt;Solve that, then you don't need to write a clever script to fix this...&lt;BR /&gt;&lt;BR /&gt;Bottom line - you will have to go through the entire file...&lt;BR /&gt;&lt;BR /&gt;You could do a&lt;BR /&gt;&lt;BR /&gt;:set nu&lt;BR /&gt;&lt;BR /&gt;in vi to see line numbers - that way you can scroll a page at a time.&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Sun, 21 Jan 2007 22:41:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929693#M287200</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2007-01-21T22:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Vi question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929694#M287201</link>
      <description>I bet this is what you are looking for.  I sure was for a number of years.&lt;BR /&gt;&lt;BR /&gt;OK Let's call your file "myfile.txt."  Let's have our formated file called "myfile.formated."&lt;BR /&gt;&lt;BR /&gt;1.  cat myfile.txt | sed G | adjust -m72 &amp;gt; myfile.formated&lt;BR /&gt;2.  vi myfile.formated.&lt;BR /&gt;3.  :g/^$/de&lt;BR /&gt;4.  :wq!&lt;BR /&gt;&lt;BR /&gt;Is this what you were looking for?&lt;BR /&gt;&lt;BR /&gt;thingy ......explanation about it.&lt;BR /&gt;&lt;BR /&gt;cat myfile.txt ....spit out the text.&lt;BR /&gt;sed G   ....double space the file.&lt;BR /&gt;adjust  -m72  ......WRAP that text when it gets to column 72.  (Just like in typing class).&lt;BR /&gt;&lt;BR /&gt;:g/^$/de   ......&lt;BR /&gt;  :        ......ed mode&lt;BR /&gt;  g        ......for all lines&lt;BR /&gt;  /^$/     ......where it is a blank line&lt;BR /&gt;  de       ......delete that line&lt;BR /&gt;&lt;BR /&gt;:wq! ....... Write, Quit, and I really mean it.&lt;BR /&gt;&lt;BR /&gt;Now file myfile.formated is probably what you wanted.  Do a man page on adjust for more details.&lt;BR /&gt;&lt;BR /&gt;Now what if you want it to be 200 characters wide and in 3 columns?   Oh I think it would be time for perl.  &lt;BR /&gt;</description>
      <pubDate>Mon, 22 Jan 2007 08:25:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929694#M287201</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2007-01-22T08:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Vi question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929695#M287202</link>
      <description>Hunki,&lt;BR /&gt;&lt;BR /&gt;What criteria are you using to decide which lines should be joined together?&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Mon, 22 Jan 2007 09:13:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929695#M287202</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2007-01-22T09:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Vi question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929696#M287203</link>
      <description>If it's really a text file (not a program source file), you can use the 'adjust'.&lt;BR /&gt;&lt;BR /&gt;I set up a macro in '.exrc' like this:&lt;BR /&gt;&lt;BR /&gt;map ^P {!}adjust -m72&lt;BR /&gt;&lt;BR /&gt;With text on the screen, put the cursor anywhere in the paragraph, type 'CTRL-p' and the whole paragraph adjusts.&lt;BR /&gt;&lt;BR /&gt;Starting at the bottom, hold down ctrl-p, and it will adjust paragraphs all the way to the top.&lt;BR /&gt;&lt;BR /&gt;I'm curious about the "... most often face ...", which makes it sound like that's your  most-used operation.  What sort of text is it?  Regular text, source code, data in text, ...?&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Jan 2007 13:52:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929696#M287203</guid>
      <dc:creator>Michael D. Zorn</dc:creator>
      <dc:date>2007-01-22T13:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Vi question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929697#M287204</link>
      <description>I don't know about the author here, but "most often face" for me is that I'm typing a document, then I need to make it pretty to printout.  &lt;BR /&gt;&lt;BR /&gt;Since I can created documents 4 to 5 times faster in vi than in MS word, I try type in vi first.&lt;BR /&gt;&lt;BR /&gt;Can you imagine keeping your fingers on the keyboard?  Never looking for the mouse?  Performing a 2000 mouse click operation with 10 keystrokes?  VI:  the ugly and extremely useful program.    &lt;BR /&gt;&lt;BR /&gt;OH OK....at least it is for me.  I've been using it since 1987.&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Jan 2007 14:00:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-question/m-p/3929697#M287204</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2007-01-22T14:00:26Z</dc:date>
    </item>
  </channel>
</rss>

