9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I'm new to scripting.. facing some problems while inserting content of a file into another file...
I want to insert content of a file (file2) into file1, before first occurrence of "line starts with pattern" in file1
file1
======
working on linux
its unix world
working on... (14 Replies)
Discussion started by: Jagadeesh Kumar
14 Replies
2. Shell Programming and Scripting
Hi friends, here is my problem.
I have three files like this..
cat file1.txt
=======
unix is best
unix is best
linux is best
unix is best
linux is best
linux is best
unix is best
unix is best
cat file2.txt
========
Windows performs better
Mac OS performs better
Windows... (4 Replies)
Discussion started by: Jagadeesh Kumar
4 Replies
3. UNIX for Beginners Questions & Answers
Hi All,
I am using UNix Sun OS sun4u sparc SUNW,SPARC-Enterprise
My intention is to insert a line of text after 13th line of every file inside a particular directory.
While trying to do it for a single file , i am using sed
sed '3 i this is the 4th line' filename
sed: command garbled: 3... (5 Replies)
Discussion started by: gotamp
5 Replies
4. Shell Programming and Scripting
I have a test file that I want to read and insert only certain lines into the
the table based on a filter.
1. Rread the log file 12 Hours back Getdate() -12 Hours
2. Extract the following information on for lines that say "DUMP is
complete"
A. Date
B. Database Name
C.... (2 Replies)
Discussion started by: JolietJake
2 Replies
5. Shell Programming and Scripting
Hi,
I need to insert a new line containing the string "QUERY" above every 5 lines.
The below piece of code inserts a new line after every 5th line
awk '{print $0} !(NR%5) {print "QUERY"}'
sed 'n;n;n;n;G;' --> I do not know how to give "QUERY" string here
But I need to insert it before... (4 Replies)
Discussion started by: royalibrahim
4 Replies
6. Shell Programming and Scripting
Hi Friends,
I am writing a shell script where it is required to insert a file say file1 into file2 after certain number of fixed lines in file2..
Please help me how this could be done.. Please suggest me any useful links i need to go through to achieve this....
Thanks in advance .. (2 Replies)
Discussion started by: amr89
2 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
I have too many .gz files (test.gz).
Task is to remove first line of each file.
Can I do it without unzipping the files?
Your help is appreciated. (4 Replies)
Discussion started by: Chulamakuri
4 Replies
8. Shell Programming and Scripting
Script 1
Pre-requisites
Create a file with x amount of lines in it, the content of your choice.
Write a script that takes two arguments. The first being a line of text, the second being your newly created file. The script should take the first argument and insert it into the very top (the... (3 Replies)
Discussion started by: ali hussain
3 Replies
9. UNIX for Advanced & Expert Users
Hello,
I need to insert a line (like a header) as the first line of a very huge file (about 3 ml rows). I am able to do it with sed, but redirecting the output and creating a new file takes quite some time. I was wondering if there was a more efficient way of doing it?
Any help would be... (3 Replies)
Discussion started by: shriek
3 Replies