Sponsored Content
Top Forums Shell Programming and Scripting sed and awk usage to grep a pattern 1 and with reference to this grep a pattern 2 and pattern 3 Post 302905337 by Scrutinizer on Wednesday 11th of June 2014 04:43:11 AM
Old 06-11-2014
Why would you want to use sed/awk for this? What are you trying to achieve? Did you have a look at the patch command?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split a file based on pattern in awk, grep, sed or perl

Hi All, Can someone please help me write a script for the following requirement in awk, grep, sed or perl. Buuuu xxx bbb Kmmmm rrr ssss uuuu Kwwww zzzz ccc Roooowwww eeee Bxxxx jjjj dddd Kuuuu eeeee nnnn Rpppp cccc vvvv cccc Rhhhhhhyyyy tttt Lhhhh rrrrrssssss Bffff mmmm iiiii Ktttt... (5 Replies)
Discussion started by: kumarn
5 Replies

2. Shell Programming and Scripting

Extracting pattern only with AWK | SED | GREP

We have the following statement working in CGYWIN, but when we move the program to Solaris 10 it fails. x=`echo "ABC196925XYZ" | grep -o --only-matching "\{6\}"` How can we use AWK or SED to extract only the number from the string? The following outputs the entire string. We only want... (5 Replies)
Discussion started by: James Clark
5 Replies

3. Shell Programming and Scripting

How to awk/sed/grep lines which contains a pattern at a given position

Dear friends I am new to linux and was trying to split some files userwise in our linux server. I have a data file of 156 continuous columns named ecscr final. I want the script to redirect all the lines containing a pattern of 7 digits to separate files. I was using grep to do that,... (2 Replies)
Discussion started by: anoopvraj
2 Replies

4. Shell Programming and Scripting

Help to search multiple pattern in file with grep/sed/awk

Hello All, I have a file which is having below type of data, Jul 19 2011 | 123456 Jul 19 2011 | 123456 Jul 20 2011 | 123456 Jul 20 2011 | 123456 Here I wanted to grep for date pattern as below, so that it should only grep "Jul 20" OR "Jul ... (9 Replies)
Discussion started by: gr8_usk
9 Replies

5. UNIX for Dummies Questions & Answers

One liner pattern search with awk/sed/grep

I have an array containing bunch of characters. I have to check this array for specific character and if "Not Found than" use a goto statement to go to USAGE set options = (A B C D E F) @ i = 0 while ($i <= ${#options}) if ($options != "F" || $options != "D") then goto USAGE endif @... (1 Reply)
Discussion started by: dixits
1 Replies

6. Shell Programming and Scripting

How to print the lines between the pattern using awk/grep/sed?

Hi, I need a help to search a pattern and print the multiple lines between them. Input file: Tue May 29 12:30:33 EDT 2012:threadWebContainer : 357:com.travimp.hotelierlinks.abba.service.RequestHandler.requestService(String, ITICSDataSet): hotelCancelReservation request: ... (4 Replies)
Discussion started by: aroragaurav.84
4 Replies

7. Shell Programming and Scripting

Sed/awk : to grep only required pattern disk

Hi Experts, Need help with the following: Desired output: Only want to get the output marked in green. The file: --- Physical volumes --- PV Name /dev/disk/disk4704 PV Status available Total PE 6399 Free PE ... (3 Replies)
Discussion started by: rveri
3 Replies

8. UNIX for Dummies Questions & Answers

Grep -v lines starting with pattern 1 and not matching pattern 2

Hi all! Thanks for taking the time to view this! I want to grep out all lines of a file that starts with pattern 1 but also does not match with the second pattern. Example: Drink a soda Eat a banana Eat multiple bananas Drink an apple juice Eat an apple Eat multiple apples I... (8 Replies)
Discussion started by: demmel
8 Replies

9. Shell Programming and Scripting

sed -- Find pattern -- print remainder -- plus lines up to pattern -- Minus pattern

The intended result should be : PDF converters 'empty line' gpdftext and pdftotext?xml version="1.0"?> xml:space="preserve"><note-content version="0.1" xmlns:/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">PDF converters gpdftext and pdftotext</note-content>... (9 Replies)
Discussion started by: Klasform
9 Replies

10. UNIX for Beginners Questions & Answers

Grep/awk using a begin search pattern and end search pattern

I have this fileA TEST FILE ABC this file contains ABC; TEST FILE DGHT this file contains DGHT; TEST FILE 123 this file contains ABC, this file contains DEF, this file contains XYZ, this file contains KLM ; I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
SHAPE_PATCH(1)						      General Commands Manual						    SHAPE_PATCH(1)

NAME
shape_patch - shapeTools RMS generate patch file SYNOPSIS
shape patch OLDRELEASE=<name1> NEWRELEASE=<name2> [PATCHFILE=<filename>] DESCRIPTION
Shape patch generates a patch file for updating $(OLDRELEASE) to $(NEWRELEASE). Both releases are identified by release names associated with the macros OLD-/NEWRELEASE on the command line. Valid release names are those generated by any of the shape_RMS (pre-)release building procedures (see shape_releas(1)). Performing 'vl -all' with the release identification file as argument usually gives a good overview of existing release names. Patch generation happens recursively over all subsystems being part of the current node. Hence, triggering shape patch from the top node of the central source repository creates a patch file for the whole system. The output of shape patch is stored in a file named <name1>+2+<name2>.pat. When the PATCHFILE macro is set on the command line, $(PATCH- FILE) is taken as output file name instead. Defining PATCHFILE=- on the command line causes the patch to be written to standard output. Note: For patches invoking multiple subsystems, $(PATCHFILE) should be set to an absolute pathname. If not, the patch generation procedure will leave an equally named patch file for each visited subsystem. The patch is constructed using the vdiff(1) command and can be applied to any installation of $(OLDRELEASE) by invoking patch(1). INCONVENIENCES
On System V machines, the generated patch file name will almost certainly exceed the 14 characters filename length limit. SEE ALSO
shape_releas(1), vdiff(1), patch(1) FILES
<name1>+2+<name2>.pat 26.9.119 SHAPE_PATCH(1)
All times are GMT -4. The time now is 03:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy