Sponsored Content
Top Forums Shell Programming and Scripting Delete multiple occurrences of the same pattern on a line but the first Post 303024026 by dis0wned on Thursday 27th of September 2018 09:52:50 AM
Old 09-27-2018
Nope, didnt do it.

------ Post updated at 01:52 PM ------

MadeInGermany, I used your approach and it works. Thanks for giving me the direction.

Below is the code that I used to complete it:
Code:
sed -i 's/,	  IP address: /,IP Address:/' $tempdir/newt4 
sed -i -e 's/,	  IP address: / /g' $tempdir/newt4

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

comment/delete a particular pattern starting from second line of the matching pattern

Hi, I have file 1.txt with following entries as shown: 0152364|134444|10.20.30.40|015236433 0233654|122555|10.20.30.50|023365433 ** ** ** In file 2.txt I have the following entries as shown: 0152364|134444|10.20.30.40|015236433 0233654|122555|10.20.30.50|023365433... (4 Replies)
Discussion started by: imas
4 Replies

2. UNIX for Dummies Questions & Answers

find pattern delete line with pattern and line above and line below

I have a file that will sometimes contain a pattern. The pattern is this: W/D FRM CHK 00 I want to find any lines with this pattern, delete those lines, and also delete the line above and the line below. (1 Reply)
Discussion started by: nickg
1 Replies

3. Shell Programming and Scripting

find pattern, delete line with pattern and line above and line below

I have a file that will sometimes contain a pattern. The pattern is this: FRM CHK 0000 I want to find any lines with this pattern, delete those lines, and also delete the line above and the line below. (4 Replies)
Discussion started by: nickg
4 Replies

4. Shell Programming and Scripting

sed replace multiple occurrences on the same line, but not all

Hi there! I am really enjoying working with sed. I am trying to come up with a sed command to replace some occurrences (not all) in the same line, for instance: I have a command which the output will be: 200.300.400.5 0A 0B 0C 01 02 03 being that the last 6 strings are actually one... (7 Replies)
Discussion started by: ppucci
7 Replies

5. Shell Programming and Scripting

CSV: Replacing multiple occurrences inside a pattern

Greatings all, I am coming to seek your knowledge and some help on an issue I can not currently get over. I have been searching the boards but did not find anything close to this matter I am struggling with. I am trying to clean a CSV file and make it loadable for my SQL*Loader. My problem... (1 Reply)
Discussion started by: OCanada
1 Replies

6. Shell Programming and Scripting

awk delete/remove rest of line on multiple search pattern

Need to remove rest of line after the equals sign on search pattern from the searchfile. Can anybody help. Couldn't find any similar example in the forum: infile: 64_1535: Delm. = 86 var, aaga 64_1535: Fran. = 57 ex. ccc 64_1639: Feb. = 26 (link). def 64_1817: mar. = 3/4. drz ... (7 Replies)
Discussion started by: sdf
7 Replies

7. Homework & Coursework Questions

sed Multiple Pattern search and delete the line

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I have file which has got the following content sam 123 LD 41 sam 234 kp sam LD 41 kam pu sam LD 61 Now... (1 Reply)
Discussion started by: muchyog
1 Replies

8. Shell Programming and Scripting

sed command to grep multiple pattern present in single line and delete that line

here is what i want to achieve.. i have a file with below contents cat fileName blah blah blah . .DROP this REJECT that . --sport 7800 -j REJECT --reject-with icmp-port-unreachable --dport 7800 -j REJECT --reject-with icmp-port-unreachable . . . more blah blah blah --dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies

9. Shell Programming and Scripting

Multiple pattern find and delete line

I have a file # cat /tmp/user_find.txt /home/user/bad_link1 /home/user/www /home/user/mail /home/user/access_logs /home/user/bad_link2 I need to delete lines where there are patterns /home/user/www, /home/user/mail and /home/user/access_logs. I used below method, but its throwing error... (8 Replies)
Discussion started by: anil510
8 Replies

10. UNIX for Advanced & Expert Users

sed REGEX to print multiple occurrences of a pattern from a line

I have a line that I need to parse through and extract a pattern that occurs multiple times in it. Example line: getInfoCall: info received please proceed, getInfoCall: info received please proceed, getInfoCall: info received please proceed, getInfoCall: info received please proceed,... (4 Replies)
Discussion started by: Vidhyaprakash
4 Replies
miniunzip(1)						      General Commands Manual						      miniunzip(1)

NAME
miniunzip - uncompress and examine ZIP archives SYNOPSIS
miniunzip [-exvlo] zipfile [ files_to_extract ] [-d tempdir] DESCRIPTION
minizip is a simple tool which allows the extraction of compressed file archives in the ZIP format used by the MS-DOS utility PKZIP. It was written as a demonstration of the zlib(3) library and therefore lack many of the features of the unzip(1) program. OPTIONS
A number of options are supported. With the exception of -d tempdir these must be supplied before any other arguments and are: -l , --v List the files in the archive without extracting them. -o Overwrite files without prompting for confirmation. -x Extract files (default). The zipfile argument is the name of the archive to process. The next argument can be used to specify a single file to extract from the ar- chive. Lastly, the following option can be specified at the end of the command-line: -d tempdir Extract the archive in the directory tempdir rather than the current directory. SEE ALSO
minizip(1), zlib(3), unzip(1). AUTHOR
This program was written by Gilles Vollant. This manual page was written by Mark Brown <broonie@sirena.org.uk>. The -d tempdir option was added by Dirk Eddelbuettel <edd@debian.org>. Nov 7, 2001 miniunzip(1)
All times are GMT -4. The time now is 06:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy