I have a record that is like this below; records like this
are delimited by --- lines; I need to write a bash script
that automatically checks for almost all the fields
defined on each row;
1- Is it difficult to write a shell script that processes
these records and checks each field in each record ?
Do you have an example script that reads a file that
contain all these records and make checks on them ?
2 - Is it better to write an awk script over shell script
if I only need to check about 10 - 12 fields in each record ? Do you have an example script that reads a file
that contain all these records and make checks on them ?
Any comments or help is appreciated.
Advance thanks
----------------------------------------------------------
Record Checksum: 110
Record Number: 1
Reference Number: 1
Record Type: 2 => MTC
IM Field Content:
IM field: (001) => IM
EVEN/ODD bit: (1) => odd
IM Id: 316
SType: 0x00 => LS
CNumber Field Content:
L: 1
Ext: (1) => No
Tnum: (001) => No
PId: (0001) => No
D:
ONum Field Content:
L: 6
Ext: (1) => No
Tnum: (001) => No
PId: (0001) => No
D: 1234567890
TNum Field Content:
L: 6
Ext: (1) => No
Tnum: (001) => No
PId: (0001) => No
D: 0987654321
CTime: 0x0000 =>
S Du: 0
C Du: 0x1 => 1
L ID: 5
C Id: 0
Cause for T: 1 => N Re
O.t g ID: 0
Diag hex dump:
00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
----------------------------------------------------------
are delimited by --- lines; I need to write a bash script
that automatically checks for almost all the fields
defined on each row;
1- Is it difficult to write a shell script that processes
these records and checks each field in each record ?
Do you have an example script that reads a file that
contain all these records and make checks on them ?
2 - Is it better to write an awk script over shell script
if I only need to check about 10 - 12 fields in each record ? Do you have an example script that reads a file
that contain all these records and make checks on them ?
Any comments or help is appreciated.
Advance thanks
----------------------------------------------------------
Record Checksum: 110
Record Number: 1
Reference Number: 1
Record Type: 2 => MTC
IM Field Content:
IM field: (001) => IM
EVEN/ODD bit: (1) => odd
IM Id: 316
SType: 0x00 => LS
CNumber Field Content:
L: 1
Ext: (1) => No
Tnum: (001) => No
PId: (0001) => No
D:
ONum Field Content:
L: 6
Ext: (1) => No
Tnum: (001) => No
PId: (0001) => No
D: 1234567890
TNum Field Content:
L: 6
Ext: (1) => No
Tnum: (001) => No
PId: (0001) => No
D: 0987654321
CTime: 0x0000 =>
S Du: 0
C Du: 0x1 => 1
L ID: 5
C Id: 0
Cause for T: 1 => N Re
O.t g ID: 0
Diag hex dump:
00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
----------------------------------------------------------