Hello guys, thank God that I found this forum.
I hope that someone can help me because I don't have any idea on how to start it. I know that for some of you this is a very simple task but I'm not as advance on shell scripting like many people out there.
I got this file with a permanent filename (RSA_RECORDS.txt) that the content always starts like this.
# ISSUER CODE: QPPS
# FROM DATE: 20090224
# TO DATE: 00000000
# SEQUENCE NUMBER: 001
# RECORD COUNT: 0000000003
# NUMBER OF FIELDS: 015
# DELIMITER: ;
BLABLABABLABLABLA
BLABLABABLABLABLA
BLABLABABLABLABLA
I need a shell script that can read those first four lines and creates a copy of that same file with the following name.
QPPS_20090224_00000000_01.txt
As you can notice the name is created by using those first four lines of the file.
<ISSUER CODE><FROM DATE><TO DATE>_<SEQUENCE NUMBER>.txt
The only issue here is that the main file changes everyday and that is the reason that I need a shell script that can dynamically create a copy of that main file with an specific name.
On my Unix server I can see that I have awk and sed support. No perl, python, ruby, etc.
Thanks for your help guys