10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file which contains two entry with spaces (either one or more than one space). ex.
now I want to... (11 Replies)
Discussion started by: anshu ranjan
2. 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
3. Shell Programming and Scripting
I have tried
sed '/6/a text_to_inserted' file > newfile
but this inserts test_to_insert at random places in file and i want it in specific location, which is line 6.
can anyone help.... (6 Replies)
Discussion started by: phenom
4. 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
5. Shell Programming and Scripting
I want to insert a text into the middle of a file (3 Replies)
Discussion started by: relle
6. Shell Programming and Scripting
how to insert one file into another file not by concatenating as usual done.
Output shud be
C D (4 Replies)
Discussion started by: cdfd123
7. Shell Programming and Scripting
I wrote a script like
echo $1 > temp
cat $2 >> temp
mv temp $2
now I have problem appending the above script(only using bash shell) so that it now inserts the first argument into the middle of the file.
I have tried using $(('wc -l < file' / 2 ))
but invain so could any one... (4 Replies)
Discussion started by: boris
8. 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
9. 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
10. Shell Programming and Scripting
I'm trying to insert a single character at position 11 in everyline of a file.
My input file looks like this:
and I want my output to look like this:
I tried the following awk code, but it's not working:... (3 Replies)
Discussion started by: mmarino
deleteln, wdeleteln, insdelln, winsdelln, insertln, winsertln - delete and insert lines in a curses window
int wdeleteln(WINDOW *win);
int insdelln(int n);
int winsdelln(WINDOW *win, int n);
int winsertln(WINDOW *win);
The deleteln and wdeleteln routines delete the line under the cursor in the window; all lines below the current line are moved up one line.
The bottom line of the window is cleared. The cursor position does not change.
The insdelln and winsdelln routines, for positive n, insert n lines into the specified window above the current line. The n bottom lines
are lost. For negative n, delete n lines (starting with the one under the cursor), and move the remaining lines up. The bottom n lines
are cleared. The current cursor position remains the same.
The insertln and winsertln routines, insert a blank line above the current line and the bottom line is lost.
All routines return the integer ERR upon failure and an OK (SVr4 specifies only "an integer value other than ERR") upon successful comple-
These functions are described in the XSI Curses standard, Issue 4. The standard specifies that they return ERR on failure, but specifies
no error conditions.
Note that all but winsdelln may be macros.
These routines do not require a hardware line delete or insert feature in the terminal. In fact, they won't use hardware line
delete/insert unless idlok(..., TRUE) has been set on the current window.