Dear All,
Please help in creating a bash script to fetch records from multiple files the script should ask inputs of file type and column level input(at least 4 col of each file type)
I have 4 sort of Files, A,B,C,D. file names are like A_0112.unl
, A_01215.unl
, A_0001.unl
and same with B C and D.
Columns in A are below:
$1== number
$2== date and time which is like |20160216124800|
$3== duration which is like "|300|" and its in seconds
$4== Charges which is like "|1|" and it is in cents
Columns in B are below:
$1== date and time which is like |20160216124800|
$2== number
$3== duration which is like "|300|" and its in seconds
$4== Charges which is like "|1|" and it is in cents
Columns in C are below:
$1== duration which is like "|300|" and its in seconds
$2== Charges which is like "|1|" and it is in cents
$3== number
$4== date and time which is like |20160216124800|
Columns in D are below:
$1== Charges which is like "|1|" and it is in cents
$2== duration which is like "|300|" and its in seconds
$3== number which is like |01171011105|
$4== date and time which is like |20160216124800|
Now when i start the script it should ask below inputs:
Input 1) Please enter file Type, Options are below:
1==A
2==B
3==C
4==D
Input 2)Please enter number which should start from 0117XXXXX.
Input 3)please enter date which should be like YYYYMMDD
Input 4)Please enter time, option are below:
1==000000 to 235959
2==000000 to 060000
3==060000 to 120000
4==120000 to 180000
5==180000 to 235959
once all the inputs are given the output should print all entries(columns) in the fully matched file. thanks.