i am reading an i/p file input.txt as below and want to read all filenames as in highlighted in bold below and put them in a different file output.txt. can someone help me with a shell script to do this? thanks in advance

regards
brad

input.txt
---------
START
TYPE:OPT
INIT_SEQ:01
FINAL_SEQ:01
DATETIME:20090424174603 FILENAME:TESTDAY.0428.20090424174530.01.OP FILE_SIZE:462 NUMBER_DOCUMENTS:1
DATETIME:20090424174604 FILENAME:TESTDAY.0428.20090424174540.01.OP FILE_SIZE:462 NUMBER_DOCUMENTS:1
DATETIME:20090424174603 FILENAME:TESTMON.0428.20090424174530.01.OP FILE_SIZE:786 NUMBER_DOCUMENTS:1
DATETIME:20090424174604 FILENAME:TESTMON.0428.20090424174540.01.OP FILE_SIZE:786 NUMBER_DOCUMENTS:1
TOTAL_FILES:4
TOTAL_DOCUMENTS:2
TOTAL_ACCOUNTS:1

output.txt
----------
TESTDAY.0428.20090424174540.01.OP
TESTDAY.0428.20090424174540.01.OP
TESTMON.0428.20090424174530.01.OP
TESTMON.0428.20090424174540.01.OP

awk  -F'[ :]' ' NF == 8 {print $4}' input.txt
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.