<?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 need help on getting data in a file in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/need-help-on-getting-data-in-a-file/m-p/3773928#M102121</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;i have this script:&lt;BR /&gt;&lt;BR /&gt;user=`whoami`&lt;BR /&gt;elist=`whoami`@mydomain.com&lt;BR /&gt;date_str=`date "+%m/%d/%y%H%M%S"`&lt;BR /&gt;subject="PDF file"&lt;BR /&gt;set -x&lt;BR /&gt;cat "$1" |tr -d `echo "\015"` &amp;gt; "$1""pdf"&lt;BR /&gt;echo "$2" "$1" "$3"&lt;BR /&gt;/baan4/c4/bse/starjet/starpage -s"$3" -c"$2" -d/tmp/$user.pdf -m:pdf "$1""pdf"&lt;BR /&gt;uuencode /tmp/$user.pdf $user$date_str.pdf | mailx -m -s "$subject" $elist&lt;BR /&gt;&lt;BR /&gt;where user will get by email a pdf file named with this format mylogindatetime.pdf&lt;BR /&gt;&lt;BR /&gt;script is working ok but here is the catch.  I need to fetch invoice number stored in "$1""pdf" and use it has a the name of the file instead of the login date and time.&lt;BR /&gt;&lt;BR /&gt;if i do a "grep Invoice" of the file i get:&lt;BR /&gt;"customer name     Invoice N:  12345 SLS"     &lt;BR /&gt;&lt;BR /&gt;how can i fetch the 12345 SLS and put it in a variable so i can use it in the script?&lt;BR /&gt;&lt;BR /&gt;I'm no expert on scripting so any help will be appreciated.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;PB</description>
    <pubDate>Wed, 19 Apr 2006 08:39:01 GMT</pubDate>
    <dc:creator>Patrice Blanchard_2</dc:creator>
    <dc:date>2006-04-19T08:39:01Z</dc:date>
    <item>
      <title>need help on getting data in a file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/need-help-on-getting-data-in-a-file/m-p/3773928#M102121</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;i have this script:&lt;BR /&gt;&lt;BR /&gt;user=`whoami`&lt;BR /&gt;elist=`whoami`@mydomain.com&lt;BR /&gt;date_str=`date "+%m/%d/%y%H%M%S"`&lt;BR /&gt;subject="PDF file"&lt;BR /&gt;set -x&lt;BR /&gt;cat "$1" |tr -d `echo "\015"` &amp;gt; "$1""pdf"&lt;BR /&gt;echo "$2" "$1" "$3"&lt;BR /&gt;/baan4/c4/bse/starjet/starpage -s"$3" -c"$2" -d/tmp/$user.pdf -m:pdf "$1""pdf"&lt;BR /&gt;uuencode /tmp/$user.pdf $user$date_str.pdf | mailx -m -s "$subject" $elist&lt;BR /&gt;&lt;BR /&gt;where user will get by email a pdf file named with this format mylogindatetime.pdf&lt;BR /&gt;&lt;BR /&gt;script is working ok but here is the catch.  I need to fetch invoice number stored in "$1""pdf" and use it has a the name of the file instead of the login date and time.&lt;BR /&gt;&lt;BR /&gt;if i do a "grep Invoice" of the file i get:&lt;BR /&gt;"customer name     Invoice N:  12345 SLS"     &lt;BR /&gt;&lt;BR /&gt;how can i fetch the 12345 SLS and put it in a variable so i can use it in the script?&lt;BR /&gt;&lt;BR /&gt;I'm no expert on scripting so any help will be appreciated.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;PB</description>
      <pubDate>Wed, 19 Apr 2006 08:39:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/need-help-on-getting-data-in-a-file/m-p/3773928#M102121</guid>
      <dc:creator>Patrice Blanchard_2</dc:creator>
      <dc:date>2006-04-19T08:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: need help on getting data in a file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/need-help-on-getting-data-in-a-file/m-p/3773929#M102122</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The use of a simple 'cut' will extract the fields you want:&lt;BR /&gt;&lt;BR /&gt;# X="customer name Invoice N: 12345 SLS" &lt;BR /&gt;# Y=`echo ${X}|cut -d" " -f 5-6`&lt;BR /&gt;# echo ${Y}&lt;BR /&gt;12345 SLS&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 19 Apr 2006 08:51:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/need-help-on-getting-data-in-a-file/m-p/3773929#M102122</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-04-19T08:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: need help on getting data in a file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/need-help-on-getting-data-in-a-file/m-p/3773930#M102123</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;This is clearer, perhaps:&lt;BR /&gt;&lt;BR /&gt;# VAR=`grep "Invoice" file|cut -d " " -f 5-6`&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 19 Apr 2006 08:54:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/need-help-on-getting-data-in-a-file/m-p/3773930#M102123</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-04-19T08:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: need help on getting data in a file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/need-help-on-getting-data-in-a-file/m-p/3773931#M102124</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if the requested items are the last part of this line:&lt;BR /&gt;&lt;BR /&gt;awk '/ Invoice / {print ($(NF-1),$NF);exit}' "$1"pdf | read num str&lt;BR /&gt;&lt;BR /&gt;and use $num and $str for these values.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Wed, 19 Apr 2006 09:35:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/need-help-on-getting-data-in-a-file/m-p/3773931#M102124</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-04-19T09:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: need help on getting data in a file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/need-help-on-getting-data-in-a-file/m-p/3773932#M102125</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;thanks for your help on this.  Both info were good.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;PB</description>
      <pubDate>Wed, 19 Apr 2006 10:30:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/need-help-on-getting-data-in-a-file/m-p/3773932#M102125</guid>
      <dc:creator>Patrice Blanchard_2</dc:creator>
      <dc:date>2006-04-19T10:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: need help on getting data in a file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/need-help-on-getting-data-in-a-file/m-p/3773933#M102126</link>
      <description>Hi,&lt;BR /&gt;grep Invoice f3|tr -d '"'|cut -d" " -f5,6|read x y&lt;BR /&gt;&lt;BR /&gt;It runs on my HPUx11i:&lt;BR /&gt;/tmp/&amp;gt;cat f3&lt;BR /&gt;"customer name Invoice N: 12345 SLS" &lt;BR /&gt;/tmp/&amp;gt;grep Invoice f3|tr -d '"'|cut -d" " -f5,6|read x y&lt;BR /&gt;/tmp/&amp;gt;echo $x&lt;BR /&gt;12345&lt;BR /&gt;/tmp/&amp;gt;echo $y&lt;BR /&gt;SLS&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art</description>
      <pubDate>Thu, 20 Apr 2006 03:19:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/need-help-on-getting-data-in-a-file/m-p/3773933#M102126</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2006-04-20T03:19:55Z</dc:date>
    </item>
  </channel>
</rss>

