<?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: file maintenance in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057984#M436162</link>
    <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I assume, that by&lt;BR /&gt;&amp;gt;&amp;gt;&lt;BR /&gt;the ending 2 when this value changes&lt;BR /&gt;&amp;lt;&amp;lt;&lt;BR /&gt;you mean:&lt;BR /&gt;with a field delimiter 'space' the last field containing numbers only&lt;BR /&gt;&lt;BR /&gt;Try&lt;BR /&gt;sed -e 's/[.]federated[.]fds / /' -e 's/ [0-9][0-9]*$//'&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
    <pubDate>Fri, 13 Jul 2007 12:09:55 GMT</pubDate>
    <dc:creator>Peter Nikitka</dc:creator>
    <dc:date>2007-07-13T12:09:55Z</dc:date>
    <item>
      <title>file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057983#M436161</link>
      <description>i have a file that the contents looks like this &lt;BR /&gt;&lt;BR /&gt;bl002amcvt187.federated.fds  0x00A0F8651EAF  2&lt;BR /&gt;&lt;BR /&gt;i know how to delete (.federated.fds) using sed, but how do i delete the ending 2 when this value changes, any help would be nice</description>
      <pubDate>Fri, 13 Jul 2007 11:52:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057983#M436161</guid>
      <dc:creator>anthony dillard_1</dc:creator>
      <dc:date>2007-07-13T11:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057984#M436162</link>
      <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I assume, that by&lt;BR /&gt;&amp;gt;&amp;gt;&lt;BR /&gt;the ending 2 when this value changes&lt;BR /&gt;&amp;lt;&amp;lt;&lt;BR /&gt;you mean:&lt;BR /&gt;with a field delimiter 'space' the last field containing numbers only&lt;BR /&gt;&lt;BR /&gt;Try&lt;BR /&gt;sed -e 's/[.]federated[.]fds / /' -e 's/ [0-9][0-9]*$//'&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Fri, 13 Jul 2007 12:09:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057984#M436162</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-07-13T12:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057985#M436163</link>
      <description>Hi Anthony:&lt;BR /&gt;&lt;BR /&gt;# perl -anle 'print join " ", @F[0..(scalar @F-3)]' file&lt;BR /&gt;&lt;BR /&gt;...will delete the last TWO fields (zero-relative) of any number of fields (as separated by whitespace) in each line of a file.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 13 Jul 2007 12:28:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057985#M436163</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-07-13T12:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057986#M436164</link>
      <description>Hi (again) Anthony:&lt;BR /&gt;&lt;BR /&gt;Well, a bit more *obvious* is this way:&lt;BR /&gt;&lt;BR /&gt;perl -anle 'print join " ", @F[0..($#F-2)]' file&lt;BR /&gt;&lt;BR /&gt;# ...will delete the last TWO fields (zero-relative) of any number of fields (as separated by whitespace) in each line of a file.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 13 Jul 2007 12:32:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057986#M436164</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-07-13T12:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057987#M436165</link>
      <description>thanks folks but this is what i have&lt;BR /&gt;&lt;BR /&gt;sed 's/.federated.fds//g' /home/b009021/host2mac1, &lt;BR /&gt;what ending do i need to used to delete the ending value in this case a number 0-9 for this entry in this file ie&lt;BR /&gt;&lt;BR /&gt;before using sed&lt;BR /&gt;bl004amcvt031.federated.fds 0x00A0F83CD702 2&lt;BR /&gt;&lt;BR /&gt;after sed&lt;BR /&gt;bl004amcvt031 0x00A0F83CD702  2&lt;BR /&gt;I still need to delete the 2&lt;BR /&gt;&lt;BR /&gt;any ideas&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Jul 2007 12:54:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057987#M436165</guid>
      <dc:creator>anthony dillard_1</dc:creator>
      <dc:date>2007-07-13T12:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057988#M436166</link>
      <description>You can use Peter's suggestion with a bit of modification&lt;BR /&gt;&lt;BR /&gt;sed -e 's/[.]federated[.]fds / /' -e 's/ [0-9]$//'&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ninad&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Jul 2007 13:27:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057988#M436166</guid>
      <dc:creator>Ninad_1</dc:creator>
      <dc:date>2007-07-13T13:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057989#M436167</link>
      <description>tried, but didnt remove dittelly</description>
      <pubDate>Fri, 13 Jul 2007 14:00:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057989#M436167</guid>
      <dc:creator>anthony dillard_1</dc:creator>
      <dc:date>2007-07-13T14:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057990#M436168</link>
      <description>I think there must be some whitespace after the last digit. Try this sed:&lt;BR /&gt;&lt;BR /&gt;sed -e 's/\.federated\.fds //' -e 's/ [0-9] *$//' &amp;lt; infile &amp;gt; outfile&lt;BR /&gt;&lt;BR /&gt;This will match a single digit separated from the preceding data by a space and followed by zero or more spaces at the end of the line.</description>
      <pubDate>Fri, 13 Jul 2007 14:27:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057990#M436168</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-07-13T14:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057991#M436169</link>
      <description>&amp;gt;Clay: sed -e 's/\.federated\.fds //' -e 's/ [0-9] *$//' &amp;lt; infile &amp;gt; outfile&lt;BR /&gt;&lt;BR /&gt;This will delete the single digit on ALL lines.&lt;BR /&gt;Is this what Anthony wants?</description>
      <pubDate>Fri, 13 Jul 2007 15:41:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057991#M436169</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-07-13T15:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057992#M436170</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Along the lines of Clay's thinking, perhaps  *whitespace* (spaces and/or tabs) trails the last digit:&lt;BR /&gt;&lt;BR /&gt;# sed -e 's/\.federated\.fds / /' -e 's/[0-9][   ]*$//' file &amp;gt; file.out&lt;BR /&gt;&lt;BR /&gt;Note that the forum doesn't render spaces and/or tab characters nor the number thereof.  Within the seemingly empty "[  ]" I typed a *space* and hit the *tab* key.&lt;BR /&gt;&lt;BR /&gt;I'm sorry for not reading your original requirement better.  I mistook "...delete the ending 2..." to mean "delete the ending 2 FIELDS...".&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 13 Jul 2007 16:19:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057992#M436170</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-07-13T16:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057993#M436171</link>
      <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;additionally or instead of a space/TAB at the end of the line (after the ' 2') it may be, that there is a CR+LF at the end of the line (being a DOS borne file).&lt;BR /&gt;If you attach - perhaps only a part - of your input data we can verify this.&lt;BR /&gt;&lt;BR /&gt;Extending my assumption about 'the ending' to:&lt;BR /&gt;"a field delimiter may be a TAB or space" I tend to some awk like this:&lt;BR /&gt;&lt;BR /&gt;awk '/.federated.fds/ {sub("[.]federated[.]fds",""); printf $1;&lt;BR /&gt; for(i=2;i&lt;NF&gt;&lt;/NF&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Fri, 13 Jul 2007 16:35:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057993#M436171</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-07-13T16:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057994#M436172</link>
      <description>Okay, to answer Dennis's concern (and frankly I don't know what the output should be), here's an all sed approach that should work (assuming there are zero or more trialing spaces).&lt;BR /&gt;&lt;BR /&gt;sed -e 's/\(.*\)\(\.federated\.fds \)\(.*\)\( [0-9] *$\)/\1 \3/' &amp;lt; infile &amp;gt; outfile&lt;BR /&gt;&lt;BR /&gt;It's using RE grouping \(...\) to grab everything before ".federated.fds " into group 1, and everything before the last space separated digit into group 3 and then substituting the saved group 1, a space, and group 3 for the line. Note that there are 4 RE Groups but we only want 2 of them when the entire RE is matched otherwise the line goes through unchanged.&lt;BR /&gt;&lt;BR /&gt;If you want to filter out possible CR's in the input then the simplest way would probably be to use tr to feed this thing.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;tr -d "\r" &amp;lt; infile | sed -e 's/\(.*\)\(\.federated\.fds \)\(.*\)\( [0-9] *$\)/\1 \3/' &amp;gt; outfile&lt;BR /&gt;&lt;BR /&gt;Now tell me that ain't some ugly sed but it should work. I've carefully looked over the logic/syntax but not executed it.</description>
      <pubDate>Fri, 13 Jul 2007 17:42:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057994#M436172</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-07-13T17:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057995#M436173</link>
      <description>&amp;gt;Clay: If you want to filter out possible CRs &lt;BR /&gt;&lt;BR /&gt;do2ux(1) is made to do just that.</description>
      <pubDate>Fri, 13 Jul 2007 17:56:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057995#M436173</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-07-13T17:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057996#M436174</link>
      <description>Oops:&lt;BR /&gt;&amp;gt;Clay: If you want to filter out possible CRs&lt;BR /&gt;&lt;BR /&gt;dos2ux(1) is made to do just that.</description>
      <pubDate>Fri, 13 Jul 2007 18:01:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057996#M436174</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-07-13T18:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057997#M436175</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;At this point it would be most helpful if you posted representative lines from the file.  In fact, posting :&lt;BR /&gt;&lt;BR /&gt;# xd -tcx file&lt;BR /&gt;&lt;BR /&gt;...output would settle the questions of whitespace and line endings (whitespace, LF, CRLF).&lt;BR /&gt;&lt;BR /&gt;Are you committed to 'sed'?  The syntax becomes clumsy and it's regular expressions are not as powerful nor easily deployed as Perl's as/if data becomes more variable and complex.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 13 Jul 2007 18:18:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057997#M436175</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-07-13T18:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057998#M436176</link>
      <description>sorry about the non response to all of your help, I just had to take a weekend for myself, I will try all of your suggestions and get back to you, again thanks for all of your input&lt;BR /&gt;&lt;BR /&gt;Anthony</description>
      <pubDate>Mon, 16 Jul 2007 08:02:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057998#M436176</guid>
      <dc:creator>anthony dillard_1</dc:creator>
      <dc:date>2007-07-16T08:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057999#M436177</link>
      <description>0007f70    8  \t   0   x   0   0   0   B   6   C   1   6   8   7   A   3&lt;BR /&gt;                38093078        30303042        36433136        38374133&lt;BR /&gt;0007f80   \t   2  \n   m   c   2   1   3   a   m   c   v   t   1   0   8&lt;BR /&gt;                 9320a6d        63323133        616d6376        74313038&lt;BR /&gt;0007f90   \t   0   x   0   0   1   0   2   0   0   0   3   B   9   1  \t&lt;BR /&gt;                 9307830        30313032        30303033        42393109&lt;BR /&gt;0007fa0    2  \n   m   c   2   1   3   a   m   c   v   t   1   0   9  \t&lt;BR /&gt;                320a6d63        32313361        6d637674        31303909&lt;BR /&gt; here you go, thanks&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Jul 2007 12:10:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5057999#M436177</guid>
      <dc:creator>anthony dillard_1</dc:creator>
      <dc:date>2007-07-16T12:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5058000#M436178</link>
      <description>Imho you could cat(1) the file to see the invisible characters embedded in the data before deciding on the command:&lt;BR /&gt;&lt;BR /&gt;# cat -vet filename</description>
      <pubDate>Mon, 16 Jul 2007 12:14:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5058000#M436178</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-07-16T12:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5058001#M436179</link>
      <description>Ok, what you thought were spaces are actually tabs; You could use awk -F "\t" to separate the fields but since I went to all the trouble to write that incredibly ugly sed, I think I will stick to it after converting your &lt;TABS&gt; to spaces via tr but Perl would probably be the best since it has a regular expression metacharacter that can represent whitespace.&lt;BR /&gt;&lt;BR /&gt;tr "\t" " " &amp;lt; infile | sed -e 's/\(.*\)\(\.federated\.fds \)\(.*\)\( [0-9] *$\)/\1 \3/' &amp;gt; outfile&lt;BR /&gt;&lt;/TABS&gt;</description>
      <pubDate>Mon, 16 Jul 2007 13:52:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5058001#M436179</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-07-16T13:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: file maintenance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5058002#M436180</link>
      <description>found my soultion&lt;BR /&gt;&lt;BR /&gt;sed 's/.federated.fds//g' /home/b009021/host2mac1 | awk '{print $1" "$2}' &amp;gt; /ho&lt;BR /&gt;me/b009021/host2mac2</description>
      <pubDate>Mon, 16 Jul 2007 14:16:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-maintenance/m-p/5058002#M436180</guid>
      <dc:creator>anthony dillard_1</dc:creator>
      <dc:date>2007-07-16T14:16:44Z</dc:date>
    </item>
  </channel>
</rss>

