Hi all,
Suppose i wish to have a file which should be something like this:
ROOH20020406080015000003
RLO00220404144142ENG01
RLO00220404123602ENG01
RLO00220404123602ENG02
As u can seeit contains 3 files.
Basically I want the header in the file to be something like this.
here ROOH will remain always(0-3)
20020406080015 (4-17) are YYYYMMDDHHMMSS.
000003(18-23) This a count.
Now my query is basically how do I pad these 0 before 3 .
Morever Tomorrow my count might be 35 or 456 then how can I automate it.
Please help if there is a way to do that.
I am able to get upto 17 and then I get 3.
I have also tried it like this.
TOTAL_FILES=`ls $DESTINATION |wc -l`
COUNT="000000"
FILE_COUNT=0
FILE_COUNT=`expr $FILE_COUNT + $TOTAL_FILES`
But still I get the file_count as 3.
Your help & suggestion will be highly appreciated.
Thanx
ROOH