<?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: Print sequence and prefix in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/print-sequence-and-prefix/m-p/5178610#M459599</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Do you mean this?&lt;BR /&gt;&lt;BR /&gt;# X="MATSX_M_2009042800009352.dat"&lt;BR /&gt;# echo ${X}|awk '{print substr($0,1,7)substr($0,21,4)}'&lt;BR /&gt;MATSX_M9352&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
    <pubDate>Mon, 01 Jun 2009 10:39:16 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-06-01T10:39:16Z</dc:date>
    <item>
      <title>Print sequence and prefix</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/print-sequence-and-prefix/m-p/5178609#M459598</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I have a file "MATSX_M_2009042800009352.dat", i just need to print sequence from the file i.e before dot 4 digits and need to print file prefix as "MATSX_M" first 7 characters of file.&lt;BR /&gt;Please help me in this issue as iam new to unix.</description>
      <pubDate>Mon, 01 Jun 2009 10:32:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/print-sequence-and-prefix/m-p/5178609#M459598</guid>
      <dc:creator>syedar</dc:creator>
      <dc:date>2009-06-01T10:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Print sequence and prefix</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/print-sequence-and-prefix/m-p/5178610#M459599</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Do you mean this?&lt;BR /&gt;&lt;BR /&gt;# X="MATSX_M_2009042800009352.dat"&lt;BR /&gt;# echo ${X}|awk '{print substr($0,1,7)substr($0,21,4)}'&lt;BR /&gt;MATSX_M9352&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Jun 2009 10:39:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/print-sequence-and-prefix/m-p/5178610#M459599</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-06-01T10:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Print sequence and prefix</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/print-sequence-and-prefix/m-p/5178611#M459600</link>
      <description>Hi JRF,&lt;BR /&gt;&lt;BR /&gt;Thanks for your support.</description>
      <pubDate>Mon, 01 Jun 2009 10:43:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/print-sequence-and-prefix/m-p/5178611#M459600</guid>
      <dc:creator>syedar</dc:creator>
      <dc:date>2009-06-01T10:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Print sequence and prefix</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/print-sequence-and-prefix/m-p/5178612#M459601</link>
      <description>&lt;!--!*#--&gt;You want to pick some components of the file name, right?&lt;BR /&gt;&lt;BR /&gt;Too bad you did not specify exactly how you wish the output formatted...&lt;BR /&gt;&lt;BR /&gt;I assume the length of the filename is fixed? If it isn't, there is a different way for pickign the sequence number, but it is not as clear as using the "cut" command.&lt;BR /&gt;&lt;BR /&gt;A short script can do the job:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;for FILENAME in "$@"&lt;BR /&gt;do&lt;BR /&gt;    PREFIX=$( echo "$FILENAME" | cut -c 1-7 )&lt;BR /&gt;    SEQUENCE=$( echo "$FILENAME" | cut -c 21-24 )&lt;BR /&gt;    echo "prefix: $PREFIX sequence: $SEQUENCE"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Save this script as a text file and give it execute permissions (chmod a+x &amp;lt;scriptname&amp;gt;).&lt;BR /&gt;Then you can use it like:&lt;BR /&gt;&lt;BR /&gt;./&amp;lt;scriptname&amp;gt; *.dat&lt;BR /&gt;&lt;BR /&gt;This script can handle an unlimited number of filenames: the effective limit is the maximum length of the command line. Wildcards are not a problem either (as they are a feature of the shell, not of the script).&lt;BR /&gt;&lt;BR /&gt;The script will produce one line of output for each name listed on the command line.&lt;BR /&gt;If you want to change the format of the output line, simply edit the "echo" line of the script.&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Mon, 01 Jun 2009 10:51:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/print-sequence-and-prefix/m-p/5178612#M459601</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2009-06-01T10:51:54Z</dc:date>
    </item>
  </channel>
</rss>

