<?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 Deleting spaces at the end of line in a file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721681#M63313</link>
    <description>How do you delete blank spaces from the end of each line in a file ? (using either a awk, sed, or just vi editor)</description>
    <pubDate>Fri, 10 May 2002 18:49:01 GMT</pubDate>
    <dc:creator>Sammy_2</dc:creator>
    <dc:date>2002-05-10T18:49:01Z</dc:date>
    <item>
      <title>Deleting spaces at the end of line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721681#M63313</link>
      <description>How do you delete blank spaces from the end of each line in a file ? (using either a awk, sed, or just vi editor)</description>
      <pubDate>Fri, 10 May 2002 18:49:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721681#M63313</guid>
      <dc:creator>Sammy_2</dc:creator>
      <dc:date>2002-05-10T18:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting spaces at the end of line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721682#M63314</link>
      <description>Hi Sam,&lt;BR /&gt;&lt;BR /&gt;Try this link,&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xed737d4cf554d611abdb0090277a778c,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xed737d4cf554d611abdb0090277a778c,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;</description>
      <pubDate>Fri, 10 May 2002 18:55:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721682#M63314</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2002-05-10T18:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting spaces at the end of line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721683#M63315</link>
      <description>This will delete trailing spaces and tabs from end of each line.&lt;BR /&gt;&lt;BR /&gt;# cat file | sed 's/[ \t]*$//' &amp;gt; newfile</description>
      <pubDate>Fri, 10 May 2002 18:57:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721683#M63315</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2002-05-10T18:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting spaces at the end of line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721684#M63316</link>
      <description>This would be one method:&lt;BR /&gt;&lt;BR /&gt;cat myfile | perl -e 'while (&lt;STDIN&gt;) { $_ =~ s/\s+/$//; print "$_\n"; }' &amp;gt; newfile&lt;BR /&gt;&lt;/STDIN&gt;</description>
      <pubDate>Fri, 10 May 2002 19:02:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721684#M63316</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-05-10T19:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting spaces at the end of line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721685#M63317</link>
      <description>If you want to do it manually, vi the file.  Go to the line you want and to the end of the line where the spaces are, then hit the 'x' key until all the spaces are gone.  Then go to the next line you want to edit and continue.&lt;BR /&gt;&lt;BR /&gt;To get out of vi, ':wq!'.  If you want to get out without saving, ':q!'.&lt;BR /&gt;&lt;BR /&gt;Hope it helps&lt;BR /&gt;&lt;BR /&gt;John</description>
      <pubDate>Fri, 10 May 2002 19:09:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721685#M63317</guid>
      <dc:creator>John Payne_2</dc:creator>
      <dc:date>2002-05-10T19:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting spaces at the end of line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721686#M63318</link>
      <description>Hi Sam you can use sed&lt;BR /&gt;&lt;BR /&gt;# delete trailing whitespace (spaces, tabs) from end of each line&lt;BR /&gt; sed 's/[ \t]*$//'   # see note on '\t' at end of file&lt;BR /&gt;&lt;BR /&gt; # delete BOTH leading and trailing whitespace from each line&lt;BR /&gt; sed 's/^[ \t]*//;s/[ \t]*$//'&lt;BR /&gt;&lt;BR /&gt;Sachin</description>
      <pubDate>Fri, 10 May 2002 19:10:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721686#M63318</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2002-05-10T19:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting spaces at the end of line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721687#M63319</link>
      <description>Thanks sanjay for the link.&lt;BR /&gt;Clay, glad you showed me a way in perl. Am learning perl and will try it.&lt;BR /&gt;Chan and Sachin, do appreciate it .&lt;BR /&gt;And John, thanks for the help but I am trying to do it globally.</description>
      <pubDate>Fri, 10 May 2002 19:36:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721687#M63319</guid>
      <dc:creator>Sammy_2</dc:creator>
      <dc:date>2002-05-10T19:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting spaces at the end of line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721688#M63320</link>
      <description>Not for the points!&lt;BR /&gt;&lt;BR /&gt;A.Clay, learn the command line switches:&lt;BR /&gt;&lt;BR /&gt;cat myfile | perl -e 'while (&lt;STDIN&gt;) { $_ =~ s/\s+/$//; print "$_\n"; }' &amp;gt; newfile&lt;BR /&gt;&lt;BR /&gt;is equal to&lt;BR /&gt;&lt;BR /&gt;perl -ple 's/\s+$//' &lt;MYFILE&gt; newfile&lt;BR /&gt;&lt;BR /&gt;easier to read, ain't it?&lt;BR /&gt;&lt;/MYFILE&gt;&lt;/STDIN&gt;</description>
      <pubDate>Sat, 11 May 2002 06:37:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721688#M63320</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-05-11T06:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting spaces at the end of line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721689#M63321</link>
      <description>N/A&lt;BR /&gt;&lt;BR /&gt;Hit submit toooo early&lt;BR /&gt;&lt;BR /&gt;cat myfile | perl -e 'while (&lt;STDIN&gt;) { $_ =~ s/\s+/$//; print "$_\n"; }' &amp;gt; newfile&lt;BR /&gt;&lt;BR /&gt;s/\s+/$// is illegal syntax, you mean s/\s+$//&lt;BR /&gt;&lt;BR /&gt;in substitutions without extra flags, the $ in perl will match *before* the newline, so above (and my previous post) will add newlines&lt;BR /&gt;&lt;BR /&gt;perl -pe 's/\s+$//' &lt;INFILE&gt;outfile&lt;BR /&gt;&lt;BR /&gt;should do. I now dropped the -l flag, which adds a newline to every print statement&lt;/INFILE&gt;&lt;/STDIN&gt;</description>
      <pubDate>Sat, 11 May 2002 06:40:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721689#M63321</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-05-11T06:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting spaces at the end of line in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721690#M63322</link>
      <description>This would seem to do it, with less hoeroglyphics than most so far...&lt;BR /&gt;&lt;BR /&gt;cat myfile|sed "s/[[:space:]]*$//" &amp;gt; newfile&lt;BR /&gt;&lt;BR /&gt;It also handles all whitespace characters.&lt;BR /&gt;BTW - is this an Oracle spool file? If so you can suppress the spaces using &lt;BR /&gt;"SET TRIMSPOOL ON".&lt;BR /&gt;&lt;BR /&gt;Graham</description>
      <pubDate>Sat, 11 May 2002 07:43:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleting-spaces-at-the-end-of-line-in-a-file/m-p/2721690#M63322</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2002-05-11T07:43:12Z</dc:date>
    </item>
  </channel>
</rss>

