Hi,
I am a newbie in UNIX and need a help here .
I have a file from which I need to extract data based on a certain search pattern.
E.g, consider the below file
Now, I need to extract the data between the patterns /* ----------- IB_QEF_INF_1244_DMFullBox_job------------/
and / ----------- IB_QEF_INF_1244_DMGRPFPMSIn_Box -----------*/.
Like this I have numberous different patterns starting with the same word IB_QEF_INF_1244*
Hope I am clear with the requirement.
Thanks
Now there's one more catch, I need to extract the data and store in a separate files with the same name given with in the pattern ( IB_QEF_INF_1244_DMFullBox_job and IB_QEF_INF_1244_DMGRPFPMSIn_Box).
Thanks for the help.
But probably I was not clear with the requirements.
In my case, the autosys jil files are not stored in server. so cant use autorep command.
The definitions are stored in a separate file and from that I want 1 file for each of the job definitions.
E.g. consider if my file contains 20 job definitions then I need 20 different files containing job definition of each one of them.
The awk command which u have provided will only extract the different job names from my file but not the definition.:wall:
My files contains all the job definitions of one server (irrespective of box/child jobs).
I created this file using a perl script during migration of Autosys 4 to Autosys 11.
Say If I have 20 jobs in my server then the file lists all 20 jobs (box+child) in a random order.
Now what I need is 20 different files for 20 jobs with their corresponding definitions.
Considering the above eg
Now what I need is 3 different files (IB_QEF_INF_1244_DMFullBox_job,IB_QEF_INF_1244_DMGRPFPMSIn_Box and IB_QEF_INF_1244_DMGRPFPMS_Box ) with their corresponding definitions (some data)
itkamaraj, this too will not help since the names doesn't necessarily contain the 'box' word and I want the job definitions too with the different files.
Can't we search for the next occurence of the string /* ------------- IB_QEF_INF_1244 and fetch all the data in between the two occurences and then store the data in a separate file named by the job name which can be fetched using the first command whihc u provided.
I am a beginner in awk/sed, so couldn't formulate a command/script which will do the same.
Please understand the output generated from the above commands are through pattern matching with the data provided by you. If there is change in pattern some where in the data, some commands/solutions would not work as expected. Your post #5 and #12 differs. Ensure you post the data with no inconsistency