join files using shell script
I have 3 files that are to be joined. Can anybody tell me how to stat writing a shell script?
And one more thing. In a file if at some point if i need to insert some text, how to do it. For eg, a file called a.txt has at somepoint "NOTHING CAN HAPPEN" line. After that if i want to insert a paragraph, can i do that? |
To join files, use:
Code:
cat inputfile1 inputfile2 inputfile3 > outputfile |
yeah i know it
if i have a file and i have to insert a paragraph at some articular localtion say line number 45 How to do it |
This will make a backup of the original file:
Code:
sed -i.bak -e'45,s/^/your new text here\n/' your_filename |
line_number=$(cat f1 |wc -l);
head -45 f1; cat f2; tail -$((line_number-45)) f1; |
well we meet again raskin.
to sailu_mvn you can try my script Code:
#!/bin/bash regards :) |
All times are GMT -5. The time now is 03:45 PM. |