Sponsored Content
Top Forums Shell Programming and Scripting Inserting blank lines after string change Post 302599773 by chrisjorg on Saturday 18th of February 2012 08:54:25 AM
Old 02-18-2012
Quote:
Originally Posted by jim mcnamara
Code:
awk 'FNR==1 {old=$1}
       old != $1 {printf("\n")}
       {print $0; old=$1} ' oldfile > newfile

That actually adds a newline for every string
line, whereas I only wanted a newline separation
for a number increment (-150 to -148 etc)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

change of a string in different lines

hello, i have a dynamic file, which is generated by an ORACLE tool. Now i want to change a string, which begins with TABLESPACE following by "Name of Tablespace". The name of the new TABLESPACE is static. Example: TABLESPACE new : APPLI old: TABLESPACE "AMITTEL" new: TABLESPACE "APPLI" ... (4 Replies)
Discussion started by: bora99
4 Replies

2. Shell Programming and Scripting

Find a string and place two blank lines

Hi friends, I am looking for a line to find a particular string in my file and once found then replace with 2-3 blank lines before the string Example: aaa 11 bbb 1 2 3 aaa 22 bbb 4 5 6 Output (4 Replies)
Discussion started by: shaliniyadav
4 Replies

3. Shell Programming and Scripting

Print lines after the search string until blank line is found

All I want is to look for the pattern in the file...If I found it at # places... I want print lines after those pattern(line) until I find a blank line. Log EXAMPLE : MT:Exception caught The following Numbers were affected: 1234 2345 2346 Error java.lang.InternalError:... (3 Replies)
Discussion started by: prash184u
3 Replies

4. Shell Programming and Scripting

Delete blank lines, if blank lines are more than one using shell

Hi, Consider a file named "testfile" The contents of file are as below first line added for test second line added for test third line added for test fourth line added for test fifth line added for test (5 Replies)
Discussion started by: anil8103
5 Replies

5. Shell Programming and Scripting

Insert a string instead of blank lines

how can i insert a string sush as "###" instead of blank lines in a file? i try this code but it doesn't work! awk 'NF<1 {$1=="###" ; print$0}' in_file > out_file (13 Replies)
Discussion started by: oreka18
13 Replies

6. Shell Programming and Scripting

Inserting new line if two sequential lines begin with the same string

Hi I have a file like this: Peter North Mary Peter North Peter Borough Mary I need there to put 'X' (or anything) on a new line between the two lines where 'Peter' begins the line. There will be many matches to this string, but they will always begin with 'Peter'. Ie, the resulting... (2 Replies)
Discussion started by: majormajormajor
2 Replies

7. Shell Programming and Scripting

Inserting blank columns in already present CSV file

Hi, i have a csv file which have headers and values of it like below : headers --> CI Ref SerialNumber LastScanDate values --> VMware-42,VMware-42,Tue, 20 May 2014 11:03:44 +0000 i want to have a above csv in below format : headers --> CI Name CI Description CI Ref... (6 Replies)
Discussion started by: omkar.jadhav
6 Replies

8. UNIX for Advanced & Expert Users

Delete blank spaces and blank lines in a file

Hi Gurus, Somebody can say me how to delete blank spaces and blank lines in a file unix, please. Thank you for advanced. (10 Replies)
Discussion started by: systemoper
10 Replies

9. Shell Programming and Scripting

To check Blank Lines, Blank Records and Junk Characters in a File

Hi All Need Help I have a file with the below format (ABC.TXT) : ®¿¿ABCDHEJJSJJ|XCBJSKK01|M|7348974982790 HDFLJDKJSKJ|KJALKSD02|M|7378439274898 KJHSAJKHHJJ|LJDSAJKK03|F|9898982039999 (cont......) I need to write a script where it will check for : blank lines (between rows,before... (6 Replies)
Discussion started by: chatwithsaurav
6 Replies

10. UNIX for Beginners Questions & Answers

Inserting a blank line at the end of a .txt file?

Hi there, I am having this problem: a) I am uploading a txt file from windows (notepad) with some Gaussian 09 command lines; b) Gaussian needs in certain command files, that those files have a blank line at the end of the file! c) I open the command file with vi and no blank line at the of... (2 Replies)
Discussion started by: luismga
2 Replies
STUND(8)																  STUND(8)

NAME
stund - STUN protocol (Simple Traversal of UDP through NATs) Server SYNTAX
stund [-v] [-h IP Address] [-a Secondary IP Address ] [-p port ] [-o port ] [-b ] [-m ] STUN servers needs two IP addresses and two ports DESCRIPTION
STUN Servers are used to help clients behind NAT to tunnel incoming calls through. This server is the counterpart to help the client iden- tify the NAT and have it open the proper ports for it OPTIONS
-v Verbose output. -h <IP Address> Define the Main IP Address. -a <IP Address> Define the Second IP Address. -p <Port> Set the primary port the default port value is 3478 -o <Port> Set the secondary port the default port value is 3479 -b Detach the process and makes the program run at the background -m <Port> Sets a starting port for the STERM server --help Prints useful help EXAMPLES
If the IP addresses of your NIC are 10.0.1.150 and 10.0.1.151 the proper and default use would be: stund -h 10.0.1.150 -a 10.0.1.151 add -b option to detach the process stund -h 10.0.1.150 -a 10.0.1.151 -b AUTHORS
This manual page was written by Rene Mayorga <rmayorga@debian.org.sv> for the Debian system (but may be used by others). Permis- sion is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. SEE ALSO
stun(1) Debian Project 2007 Aug 31 STUND(8)
All times are GMT -4. The time now is 01:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy