<?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: usinf sed in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889865#M845960</link>
    <description>Hi guys,&lt;BR /&gt;&lt;BR /&gt;   Thanks for the input, my case is alittle more troublesome, as the I only want the data between W and the 1, and as the number of characters for the data differs from time to time it may be alittle difficult to achieve. I have tried using a script to do it.. but its really bulky.. do u guys have any idea?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank u!!</description>
    <pubDate>Mon, 07 Mar 2005 06:17:50 GMT</pubDate>
    <dc:creator>Henry Chua</dc:creator>
    <dc:date>2005-03-07T06:17:50Z</dc:date>
    <item>
      <title>usinf sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889859#M845954</link>
      <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;  I'll need to extract data from the following field "WJV82LV83A1.ICZ34K.ws". The data I need is captured between W and the . , i.e. JV82LV83A in this case. as the data may differ in lenght i tried using a combo of awk and sed to do it.. but the script got quite bulky though it did the job., Is there a easier way. I'll need to reduce the speed and alot of data to capture. any advise?&lt;BR /&gt;&lt;BR /&gt;thank u&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Mar 2005 05:32:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889859#M845954</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-03-07T05:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: usinf sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889860#M845955</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;echo "WJV82LV83A1.ICZ34K.ws"|awk -F"." '{print $1}'|cut -c2-&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Mar 2005 05:42:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889860#M845955</guid>
      <dc:creator>Olivier LEGRAND</dc:creator>
      <dc:date>2005-03-07T05:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: usinf sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889861#M845956</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Use the SHELL variable IFS and cut&lt;BR /&gt;&lt;BR /&gt;Or cut with the -d option if the &lt;BR /&gt;data field format is stable&lt;BR /&gt;&lt;BR /&gt;echo "WJV82LV83A1.ICZ34K.ws". |cut -f1 -d"."|cut -f2 -d"\""&lt;BR /&gt;&lt;BR /&gt;        Steve Steel</description>
      <pubDate>Mon, 07 Mar 2005 05:53:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889861#M845956</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2005-03-07T05:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: usinf sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889862#M845957</link>
      <description>Try this as,&lt;BR /&gt;echo "WJV82LV83A1.ICZ34K.ws"| awk -F"." '{ print substr($1,2); }'&lt;BR /&gt;&lt;BR /&gt;HTH.</description>
      <pubDate>Mon, 07 Mar 2005 06:09:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889862#M845957</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-03-07T06:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: usinf sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889863#M845958</link>
      <description>Hi Henry,&lt;BR /&gt;Assuming you always want to drop the first character and keep everything after it up until the first dot (.) then:&lt;BR /&gt;&lt;BR /&gt;str1="WJV82LV83A1.ICZ34K.ws"&lt;BR /&gt;tmp=${str1#?}&lt;BR /&gt;echo $tmp&lt;BR /&gt;JV82LV83A1.ICZ34K.ws&lt;BR /&gt;str2=${tmp%%.*}&lt;BR /&gt;echo $str2&lt;BR /&gt;JV82LV83A1&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Mar 2005 06:10:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889863#M845958</guid>
      <dc:creator>Gordon  Morrison_1</dc:creator>
      <dc:date>2005-03-07T06:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: usinf sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889864#M845959</link>
      <description>IF you are date contains W*****.I** then, it is easy to do with sed as,&lt;BR /&gt;&lt;BR /&gt;echo "WJV82LV83A1.ICZ34K.ws"| sed 's/^W\(.*\).I.*/\1/'&lt;BR /&gt;&lt;BR /&gt;HTH.</description>
      <pubDate>Mon, 07 Mar 2005 06:13:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889864#M845959</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-03-07T06:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: usinf sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889865#M845960</link>
      <description>Hi guys,&lt;BR /&gt;&lt;BR /&gt;   Thanks for the input, my case is alittle more troublesome, as the I only want the data between W and the 1, and as the number of characters for the data differs from time to time it may be alittle difficult to achieve. I have tried using a script to do it.. but its really bulky.. do u guys have any idea?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank u!!</description>
      <pubDate>Mon, 07 Mar 2005 06:17:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889865#M845960</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-03-07T06:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: usinf sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889866#M845961</link>
      <description>Hi Henry,&lt;BR /&gt;If you just want everything between (but not including) the fiorst character on the line, and the last character before the first dot, then:&lt;BR /&gt;&lt;BR /&gt;str1="WJV82LV83A1.ICZ34K.ws"&lt;BR /&gt;tmp=${str1#?}&lt;BR /&gt;echo $tmp&lt;BR /&gt;JV82LV83A1.ICZ34K.ws&lt;BR /&gt;str2=${tmp%%?.*}&lt;BR /&gt;echo $str2&lt;BR /&gt;JV82LV83A</description>
      <pubDate>Mon, 07 Mar 2005 06:20:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889866#M845961</guid>
      <dc:creator>Gordon  Morrison_1</dc:creator>
      <dc:date>2005-03-07T06:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: usinf sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889867#M845962</link>
      <description>Hmmm, maybe there is something you are stil not specifying, as at first observation all posted suggestion would work, and would allow for a variable match count.&lt;BR /&gt;&lt;BR /&gt;Here is yest another awk solution:&lt;BR /&gt;&lt;BR /&gt;echo WJV82LV83A1.ICZ34K.ws | awk '{print substr($0,2,index($0,".")-2)}'&lt;BR /&gt;&lt;BR /&gt;Or if the W is not not really only the first character as sugggested, but the fist W then:&lt;BR /&gt;&lt;BR /&gt;echo WJV82LV83A1.ICZ34K.ws | awk '{w=index($0,"W")+1;print substr($0,w,index($0,".")-w)}'&lt;BR /&gt;&lt;BR /&gt;With perl, you don't get the 'newline'.&lt;BR /&gt;It could look like:&lt;BR /&gt;&lt;BR /&gt;echo WJV82LV83A1.ICZ34K.ws | perl -ne 'print $1 if (/W([^.]+)/)'&lt;BR /&gt;&lt;BR /&gt;the ERE says: When you see a W, start to remember "(" one or more "+" non-periods "^."&lt;BR /&gt;&lt;BR /&gt;In this case it looks like you could also write:&lt;BR /&gt;echo WJV82LV83A1.ICZ34K.ws | perl -ne 'print $1 if (/W([A-Z0-9]+)/)'&lt;BR /&gt;&lt;BR /&gt;Here the ERE says: one or more characters from the A-Z range or 0-9 range.&lt;BR /&gt;&lt;BR /&gt;With a perl solution you cn often do much more of the final processing all rigt there in perl.&lt;BR /&gt;&lt;BR /&gt;Anyway... what specification detail are we missing?&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Mar 2005 07:33:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889867#M845962</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-03-07T07:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: usinf sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889868#M845963</link>
      <description>Thanks for the help Guys.. Hello Hein, actually, what I meant was to capture "JV82LV83A" out of "WJV82LV83A1.ICZ34K.ws".. I have tried the suggestion and it gives "JV82LV83A1" instead, is there anyway I can get rid of the 1? .. "JV82LV83A" is the data i wanted, and as there are no fix pattern or number to it, I could not just cut out the string... can this be done?&lt;BR /&gt;&lt;BR /&gt;sorry for the trouble..&lt;BR /&gt;&lt;BR /&gt;thank u!!&lt;BR /&gt;Henry</description>
      <pubDate>Mon, 07 Mar 2005 08:37:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889868#M845963</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-03-07T08:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: usinf sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889869#M845964</link>
      <description>Hi&lt;BR /&gt;echo "WJV82LV83A1.ICZ34K.ws"|awk -F"." '{print $1}'|cut -c2-|sed s/.$//&lt;BR /&gt;&lt;BR /&gt;Best regards &lt;BR /&gt;Olivier</description>
      <pubDate>Mon, 07 Mar 2005 08:45:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889869#M845964</guid>
      <dc:creator>Olivier LEGRAND</dc:creator>
      <dc:date>2005-03-07T08:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: usinf sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889870#M845965</link>
      <description>thanks Olivier, thats wat I am lookin for!!&lt;BR /&gt;&lt;BR /&gt;thanks guys!!</description>
      <pubDate>Mon, 07 Mar 2005 08:59:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/usinf-sed/m-p/4889870#M845965</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-03-07T08:59:11Z</dc:date>
    </item>
  </channel>
</rss>

