9 More Discussions You Might Find Interesting
1. Linux
Hi
I want to extend following command so that on the basis of "Branch: ****" on the third line I can grep and print name of the file on the first line.
cat .labellog.emd | grep DA2458A7962276A7E040E50A0DC06459 | cut -d " " -f2 | grep -v branch_name | xargs -I file <command to describe> file
... (1 Reply)
Discussion started by: ezee
1 Replies
2. Shell Programming and Scripting
Hi all,
I have file on which I do grep on "/tmp/data" then I get 5 lines as
dir Path: /tmp/data/20162343134
Starting to listen on ports logging:
--
Moving results files from local storage: /tmp/resultsFiles/20162343134/*.gz to NFS: /data/temp/20162343134/outgoing
from above got to get... (7 Replies)
Discussion started by: girijajoshi
7 Replies
3. Shell Programming and Scripting
I have a file and when I match the word "initiators" in the first column I need to be able to print the rest of the columns in that row. This is fine for the most part but on occasion the "initiators" line gets wrapped to the next line. Here is a sample of the file.
caw-enabled ... (3 Replies)
Discussion started by: kieranfoley
3 Replies
4. Shell Programming and Scripting
Good day,
I have a list of regular expressions in file1. For each match in file2, print the containing line and the line after.
file1:
file2:
Output:
I can match a regex and print the line and line after
awk '{lines = $0} /Macrosiphum_rosae/ {print lines ; print lines } '
... (1 Reply)
Discussion started by: pathunkathunk
1 Replies
5. UNIX for Dummies Questions & Answers
I'm using sh on hp-ux and want to find / print a line that matches 132.101- and the next line, too. grep -A isn't supported on hp-ux, so I'm trying awk and sed.
The code below works but only prints the first occurence. I need all matches from the file.
awk... (2 Replies)
Discussion started by: Scottie1954
2 Replies
6. Shell Programming and Scripting
I need some help. I have a file (all.txt) whereby I want to substitute using sed/awk all lines that matches an expression with another line with different expression i.e
subtitute expression,
database_id: filename;
WITH
database_id: PY;
There are many occurrences of the expression... (4 Replies)
Discussion started by: aimsoft
4 Replies
7. Shell Programming and Scripting
Hi all,
I got several lines line this
a b c d e 1 e
a 1 c d e 3 f
a b c 1 e 8 h
a b c d e 1 w
a 1 c d e 2 w
a b c d e 1 t
a b c d e 7 4
How can I print the line if 1 is the field one before the last field?
Basicly this 2 field ?
a b c d e 1 e
a b c d e 1 t
The file I got is... (7 Replies)
Discussion started by: stinkefisch
7 Replies
8. UNIX for Advanced & Expert Users
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
9. Shell Programming and Scripting
Hi
I have an Input of following sort
AAAA:
ProgName="PROGRAM"
BBBB:
ProgName="BBBBBB"
CCCC:
DDDD:
ProgName="PROGRAM"
SSSS:
ProgName="PROGRAM"
ZZZZ:
ProgName="PROGRAM"
I want to find the Lines which are followed by ProgName="PROGRAM"
Out Put
AAAA: (11 Replies)
Discussion started by: pbsrinivas
11 Replies