10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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.
fc2/12 is up
Port description is SEIEDISCOVER-3
Speed is 4 Gbps
fc2/13 is down (Administratively down)
fc2/14 is up
Port... (1 Reply)
Discussion started by: kieranfoley
1 Replies
2. UNIX for Dummies Questions & Answers
I am trying to remove columns 81-97 from a line that can be as long as 114 characters. Because a number of lines might not have under 80 characters, using the cut command following by paste could be a problem. While sed might work, is there some other utility that could do this more easily?
... (9 Replies)
Discussion started by: wbport
9 Replies
3. UNIX for Dummies Questions & Answers
This could be a really dummy question.
I have a log text file.
What unix command to extract line from specific string to another specific string.
Is it something similar to?:
more +/"string" file_name
Thanks (4 Replies)
Discussion started by: aku
4 Replies
4. Shell Programming and Scripting
Hi
I have a file like
# vi require.txt
1,BANK,Read blocks that cycle.
yellow
Read blocks.
2,ACCOUNT,Finished
Red
Finished .
3,LOAN, pipe
white
pipe
4,PROFIT,Resolve.
black
Resolve
Am using like
cat require.txt | grep -w ACCOUNTThe output I get is (8 Replies)
Discussion started by: Priya Amaresh
8 Replies
5. Shell Programming and Scripting
I am trying to find a specific set of characters in a long file. I only want to find the characters in column 265 for 4 bytes.
Is there a search for that? I tried cut but couldn't get it to work.
Ex. I want to find '9999' in column 265 for 4 bytes. If it is in there, I want it to print... (12 Replies)
Discussion started by: Drenhead
12 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I have a file which lines' words are comma separated:
aa, bb, cc, uu b, ee, ff
bb, cc, zz, ee, ss, kk
oo, bb, hh, uu a, xx, ww
tt, aa, dd, yy aa, gg
I want to sort first by second column and in case of tie by fourth column with sort command.
So the output would be:
... (4 Replies)
Discussion started by: asanchez
4 Replies
7. Shell Programming and Scripting
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)
Discussion started by: SEinT
4 Replies
8. Shell Programming and Scripting
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)
Discussion started by: rany1
5 Replies
9. Shell Programming and Scripting
Hello experts,
I am new to this group and to 'SED' and 'AWK'. I have data (text file) with 5 columns (C_1-5) and 100s of lines (only 10 lines are shown below as an example). I have to find or select only the id numbers (C-1) of specific lines with '90' in the same line (of C_3) AND with '20' in... (6 Replies)
Discussion started by: kamskamu
6 Replies
10. Shell Programming and Scripting
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)
Discussion started by: jehrome_rando
1 Replies