Sponsored Content
Top Forums Shell Programming and Scripting Inserting a line in a file after every alternate line Post 302437188 by alister on Wednesday 14th of July 2010 09:04:58 AM
Old 07-14-2010
Code:
sed 'a\
Delay 1
'

Regards,
Alister
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Inserting New Line in File using Sed ??

Dear All, I have a file called football where i have a list of 11 players each on different lines. I wish to add a name of another player on the first line. I have created a file called footballscript in vi writing the following sed command to achieve this ... cat football | sed -e '1 i\... (4 Replies)
Discussion started by: Mary_xxx
4 Replies

2. Shell Programming and Scripting

inserting a new line in a file

I'm sure you guys have answered this elsewhere but I can't seem to find where so here goes. #!/bin/bash n=120 a=$(sed '120q;d' energy.xvg) while ;do a=$(sed $n'q;d' energy.xvg) echo "$a \n" > newfile n=$(($n+100)) done exit 0 that script should read the file energy.xvg, start at... (1 Reply)
Discussion started by: gelitini
1 Replies

3. UNIX for Advanced & Expert Users

Inserting a line before the line which matches the patter

Hi Is there any command where we can insert a line "2|||" before every line starting with "3|" my input is as follows 1|ETG|12345 3|79.58|||GBP|| 1|ETG|12345 3|79.58|||GBP|| 1|ETG|12345 2|EN_GB||Electrogalvanize 0.5 m2 ( Renault ) 1|ETG|12345 3|88.51|||GBP|| desired output... (10 Replies)
Discussion started by: laxmi131
10 Replies

4. Shell Programming and Scripting

Need Help in Inserting a new line in a file using PERL

I need a perl script to find and replace a specific pattern in a file to a new line. BAsically I have a single line data in a file with 10 mb to 200 MB. I want to put a new line based on a specific pattern to open the file in Excel / Access. Following is the sample data in a file ... (1 Reply)
Discussion started by: portalfaq
1 Replies

5. Shell Programming and Scripting

sed: appending alternate line after previous line

Hi all, I have to append every alternate line after its previous line. For example if my file has following contents line 1: unix is an OS line 2: it is open source line 3: it supports shell programming line 4: we can write shell scripts Required output should be line1: unix is an OS it is... (4 Replies)
Discussion started by: rish_max
4 Replies

6. Shell Programming and Scripting

inserting line to a file

I have posted it previously but somehow could not delete the previous post.I felt i could not explain the problem statement well. Here t goes.I have a file say File1. Now i need a specific pattern from the lines to be added to the other line. File: red blue green ABC.txt@ABC END black... (1 Reply)
Discussion started by: ngupta
1 Replies

7. Shell Programming and Scripting

Inserting IP in one line of a file

Hi, I have this line: ip=111.222.133.144,mac=00:16:3E:2A:08:3C,vifname=veth360','ip=10.2.3.4,vifname=veth360a' ^ | ------- I want to insert this IP 144.133.222.111 between "144"... (4 Replies)
Discussion started by: iga3725
4 Replies

8. Shell Programming and Scripting

Inserting a new line into an already existing file

hello .. I am new to perl scripting, I have a text file, and would like to insert 3 new lines into the same file at different line numbers using perl scripting. Any Help regarding this will be very useful. say the file is sample.txt, contents are aaaaa bbbb ccccc dddd eeeee ffffffff... (4 Replies)
Discussion started by: hemalathak10
4 Replies

9. Shell Programming and Scripting

Commenting a specific line and inserting a new line after commented line.

Hello All, I have following file contents cat file #line=aaaaaa #line=bbbbbb #line=cccccc #line=dddddd line=eeeeee #comment=11111 #comment=22222 #comment=33333 #comment=44444 comment=55555 Testing script Good Luck! I would like to comment line line=eeeeee and insert a new line... (19 Replies)
Discussion started by: manishdivs
19 Replies

10. Shell Programming and Scripting

Inserting a line to a file

Hi, consider a file called mobile.txt as follows: For type lovers, add a new line at the end of it by copying its previous line and add a +1 to the field1, field2 Additionally, there are only 3 plans available to lovers type, so it should not work for lovers type already having 3 lines under... (11 Replies)
Discussion started by: Gautham
11 Replies
NWBPSET(1)							      nwbpset								NWBPSET(1)

NAME
nwbpset - Create a bindery property or set its value SYNOPSIS
nwbpset [ -h ] [ -S server ] [ -U user name ] [ -P password | -n ] [ -C ] DESCRIPTION
nwbpset Reads a property specification from the standard input and creates and sets the corresponding property. The format is determined by the output of 'nwbpvalues -c'. nwbpset will hopefully become an important part of the bindery management suite of ncpfs, together with As another example, look at the following command line: nwbpvalues -t 1 -o supervisor -p user_defaults -c | sed '2s/.*/ME/'| sed '3s/.*/LOGIN_CONTROL/'| nwbpset With this command, the property user_defaults of the user object 'supervisor' is copied into the property login_control of the user object 'me'. nwbpvalues -t 1 -o me -p login_control -c | sed '9s/.*/ff/'| nwbpset This command disables the user object me. Feel free to contribute other examples! nwbpset looks up the file $HOME/.nwclient to find a file server, a user name and possibly a password. See nwclient(5) for more information. Please note that the access permissions of $HOME/.nwclient MUST be 600 for security reasons. OPTIONS
-h -h is used to print out a short help text. -S server server is the name of the server you want to use. -U user user is the user name to use for login. -P password password is the password to use for login. If neither -n nor -P are given, and the user has no open connection to the server, nwbpset prompts for a password. -n -n should be given if no password is required for the login. -C By default, passwords are converted to uppercase before they are sent to the server, because most servers require this. You can turn off this conversion by -C. AUTHORS
nwbpset was written by Volker Lendecke. See the Changes file of ncpfs for other contributors. nwbpset 8/7/1996 NWBPSET(1)
All times are GMT -4. The time now is 04:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy