10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to add few new columns in existing file .Any help would be great
New file(com1,sal are new)
mohan (1 Reply)
Discussion started by: mohan705
2. Shell Programming and Scripting
I have a comma separated flat file. It contains some 20 columns. I want to add two new columns at position 2,3. So that file will have 22 columns. I am providing here sample data with file having 4 columns. Appreciate your help in finding solution for this.
data in input file:... (11 Replies)
Discussion started by: ravi.videla
3. Shell Programming and Scripting
So far i've made a script that takes two argument, 1st is the contents and the 2nd is the named file. At the moment i've managed to insert new contents as a new line at the top, but i want to ask how can you insert contents in the middle of the file?
#Write... (3 Replies)
Discussion started by: zen10
4. Shell Programming and Scripting
Below is my issue which I desperately need and I want a shell script which can do this job.
1. There are 10 log files in a particular location.
2. open each log file. Goto to the end of the file. From the end go up to find a particular text. From this particular text till the end of... (3 Replies)
Discussion started by: kashriram
5. Shell Programming and Scripting
I've got a configuration file that is filled with xml text statements for example:
<data id="java-options" value="-server -Djava.security.policy..../>
I want to write a korn shell script that will go to this specific line and add a... (2 Replies)
Discussion started by: progkcp
6. UNIX for Dummies Questions & Answers
Hey guys, how do we take a line of text as an argument from a user and then insert it in the middle of a file irrespective of the number of lines in the file. I am trying to do this without SED or AWK. Inserting it in the beginning and at the end is easy, but i am trying to accomplish inserting... (6 Replies)
Discussion started by: kartikkumar84@g
7. Shell Programming and Scripting
Can anyone help me pls? I want to add a text into the middle of file.
I've writtenthe following script
text to add="$1"
lines=$(wc -l $2)
half_lines=$(expr $lines / 2)
head -$half_lines $2 > temp
echo "text to add" >> temp
((half_lines=$half_lines + 1))
tail -$half_lines $2... (6 Replies)
Discussion started by: relle
8. Shell Programming and Scripting
I want to insert a text into the middle of a file (3 Replies)
Discussion started by: relle
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
how do u insert text into a specific place in a file, say the middle for example, without changing the name for that file (1 Reply)
Discussion started by: mopimp