Printing multiple lines on the same line between specific text
This is an extract from a large file. The lines that start with fc are ports on a fabric switch. In between each fc port there is information about the port.
I want to be able to be able to print certain pieces of information for every fc port on the same line. So I would like the output to look like this. If a port is down then I want to skip to the next port that is up.
Is there a way to do this using awk? I appreciate any help on this.
---------- Post updated at 03:58 PM ---------- Previous update was at 02:59 PM ----------
I have figured this out from looking at other posts.
get me everything in one line in between each fc and from this I am able filter out the info I need.
I have this files:
./frm/lf_mt1_cd.Ic_cell_template.attr
./die/addgen_tb_pumd.Ic_cell_template.attr
./min_m1_n.Ic_cell_template.attr
When I use:
awk -F\/ '{print NF}'
Would result to:
3
3
2
I would like to list the files with 3 fields on it. Any Suggestions? (1 Reply)
Hi
I would like to replace specific line eg ExitAction = NONE to ExitAction = FALSE under only TASK sipsiproc and other ExitAction = NONE will remain as usual in the file(shell script)
The file contains:
TASK rgcdproc {
CommandLine = $SSHOME/bin/rgcd.exe
NewConsole... (5 Replies)
Hi
I want to extract certain text between two line numbers like
23234234324 and
54446655567567
How do I do this with a simple sed or awk command?
Thank you.
---------- Post updated at 06:16 PM ---------- Previous update was at 05:55 PM ----------
found it:
sed -n '#1,#2p'... (1 Reply)
I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it.
For example, Here is a portion of a zone file.
IN NS ns1.domain.tld.
IN NS ns2.domain.tld.
IN ... (2 Replies)
Hello,
I want to print a number of lines of a file after a specific expression of a line.
I have this sed command but it prints only 1 line after the expression.
How could I adapt it to print for instance 10 lines after or 15 lines after ?
sed -n '/regexp/{n;p;}'
Thx & Regs,
Rany. (5 Replies)
Hello all,
I need to print all the lines before a specific string and print a custom message 2 lines after that.
So far I have managed to print everything up the string, inclusively, but I can't figure out how to print the 2 lines after that and the custom message.
My code thus far is:... (4 Replies)
this is Korn shell unix.
The scenario is I have a pipe delimited text file which needs to be customized. say for example,I have a pipe delimited text file with 15 columns(| delimited) and 200 rows. currently the 11th and 12th column has null values for all the records(there are other null columns... (4 Replies)
I can't decide if I should use AWK or PERL after pouring over these forums for hours today I decided I'd post something and see if I couldn't get some advice.
I've got a text file full of hundreds of events in this format:
Record Number : 1
Records in Seq : ... (3 Replies)
Hi
I have a file which is tab-delimited. Now, I'd like to print the lines which have "chr6" string in both first and second columns. Could anybody help? (3 Replies)
I'm trying to remove a specific number of lines, above and below a specific line of text, highlighted in red:
<STMTTRN>
<TRNTYPE>CREDIT
<DTPOSTED>20151205000001
<TRNAMT>10
<FITID>667800001
<CHECKNUM>667800001
<MEMO>BALANCE
</STMTTRN>
<STMTTRN>
<TRNTYPE>DEBIT
<DTPOSTED>20151207000001... (8 Replies)