Tag Archives: Digit Number Numeric

Selective position file editing inside folder

I need to process 4 files having name pattern as followis:-
1) Each file starts with = ABCJmdmfbsjop letters + 7 Digit Number _mm-dd-yyyy-hh-mm-ss-3 Digit Number.data
where ABCJmdmfbsjop :- is alphabet. Each file starts with this ABCJmdmfbsjop alphabet.
7 Digit Number :- Numeric 7 digits.
__:- Underscore character
mm-dd-yyyy-hh-mm-ss :- This will be today’s month-date-Year-Hour-Minutes-seconds
3 digit number This cauld be any number.
.data:- this will be extension of the file. follwing script find these files.

Code:

TS=`date +”%m-%d-%Y”`| for fname in `find . -name “ABCJmdmfbsjop???????_${TS}*.data”`
do # use those cut statements here done

TASK:- In each 5 record and 8 record there are numbers in positions 88-94. We need to renumber the existing numbers from pos 88-94 in each file starting with 0000001 for File 1 update this number in ascending order until the last 8 record in the file. Whatever number we end with in the A file we need to start with the next number in the file 2 and so on until we have done File1, File2, File3 & File4.
Guys please help me if you have time.
Thanks in Advance.
-Lance

Source: The UNIX and Linux Forums