wellster34
Programmer
Hi,
I have a data file (input_file.dat):
BEGIN DATA EXTRACT
1|AUG-05|10002|2260388115.38|-4151079.23|2256237036.15|0|0
1|SEP-05|10002|2256237036.15|-4612568.24|2251624467.91|0|0
1|AUG-05|10002|1843860115.32|61745489.54|1905605604.86|0|0
1|SEP-05|10002|-488569233.24|0|-488569233.24|0|0
END DATA EXTRACT
I need to capture the results between the HEADER (BEGIN DATA EXTRACT) and the FOOTER (END DATA EXTRACT) via a unix command(s).
Is there a sed command or some other command to perform this?
I have tried the following command:
sed '/BEGIN DATA EXTRACT/d;/END DATA EXTRACT/q' input_file.dat > new_input_file.dat
and it gives me the following results:
1|AUG-05|10002|2260388115.38|-4151079.23|2256237036.15|0|0
1|SEP-05|10002|2256237036.15|-4612568.24|2251624467.91|0|0
1|AUG-05|10002|1843860115.32|61745489.54|1905605604.86|0|0
1|SEP-05|10002|-488569233.24|0|-488569233.24|0|0
END DATA EXTRACT
This is a step in the right direction but is there a way to remove the footer???
Any ideas would be greatly appreciated!!!
Thanks for your time
I have a data file (input_file.dat):
BEGIN DATA EXTRACT
1|AUG-05|10002|2260388115.38|-4151079.23|2256237036.15|0|0
1|SEP-05|10002|2256237036.15|-4612568.24|2251624467.91|0|0
1|AUG-05|10002|1843860115.32|61745489.54|1905605604.86|0|0
1|SEP-05|10002|-488569233.24|0|-488569233.24|0|0
END DATA EXTRACT
I need to capture the results between the HEADER (BEGIN DATA EXTRACT) and the FOOTER (END DATA EXTRACT) via a unix command(s).
Is there a sed command or some other command to perform this?
I have tried the following command:
sed '/BEGIN DATA EXTRACT/d;/END DATA EXTRACT/q' input_file.dat > new_input_file.dat
and it gives me the following results:
1|AUG-05|10002|2260388115.38|-4151079.23|2256237036.15|0|0
1|SEP-05|10002|2256237036.15|-4612568.24|2251624467.91|0|0
1|AUG-05|10002|1843860115.32|61745489.54|1905605604.86|0|0
1|SEP-05|10002|-488569233.24|0|-488569233.24|0|0
END DATA EXTRACT
This is a step in the right direction but is there a way to remove the footer???
Any ideas would be greatly appreciated!!!
Thanks for your time