alibaba786
Programmer
I am trying to extract information by date from three different files and want to write in the result.txt file
Trying to write extracted info to the result.txt file
By this way , sed command overwrites the result.txt file , and show the result of the last command.
How can i append the data to the previously extracted data in the result.txt file
Code:
File1.txt
----------
2009-02-24 12:13:29> [INFO] System version 6.2.0.26
2009-02-24 12:13:30> [INFO] HW version 2.4
2009-02-24 12:13:31> [INFO] Ocean version 5.6.5
2009-02-24 12:13:32> [INFO] Timezone
File2.txt
2009-02-24 12:13:29> [INFO] numCANChannels = 2
2009-02-24 12:13:29> [INFO] numFlexRayChannels = 0
2009-02-24 12:13:29> [INFO] numLinChannels = 0
2009-02-24 12:13:29> [INFO] numMOST150Channels = 0
File3.txt
---------
2009-02-24 12:13:29> [INFO] ST10-MB bitrate = 4000000
2009-02-24 12:13:29> [INFO] getBitrateProc: /proc/driver
2009-02-24 12:13:29> [INFO] DSP-MB bitrate = 6000000
Trying to write extracted info to the result.txt file
Code:
sed -n -f '/^2009-02-24 12:13:29/,/^2009-02-24 12:13:33/p' File1.txt > result.txt
sed -n -f '/^2009-02-24 12:13:29/,/^2009-02-24 12:13:33/p'
File2.txt > result.txt
sed -n -f '/^2009-02-24 12:13:29/,/^2009-02-24 12:13:33/p'
File3.txt > result.txt
By this way , sed command overwrites the result.txt file , and show the result of the last command.
How can i append the data to the previously extracted data in the result.txt file