10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have a directory of files, I can show the number of lines in each file and order them from lowest to highest with:
wc -l *|sort
15263 Image.txt
16401 reference.txt
40459 richtexteditor.txt
How can I also print the number of unique lines in each file?
15263 1401 Image.txt
16401... (15 Replies)
Discussion started by: spacegoose
15 Replies
2. Shell Programming and Scripting
Hello people,
I have a file like that:
start something
1 xxx yyy
2 zzz xxx
3 ccc vvv
4 mmm nnn
stop something
1 aaa bbb
2 ccc ddd
3 eee fff
4 qqq www
start something
1 rrr ttt
2 yyy uuu
3 iii ooo
4 ppp sss
And I need only line starting with 1 and 3 and only after start... (7 Replies)
Discussion started by: apenkov
7 Replies
3. Shell Programming and Scripting
So I have a file in the form
>
akdfvcnciejcndmdjfk
>
kdjkkkifjeeeeelfjfuf
>
fjfhchdejhfhfhfhfhfhf
>
skdkdhfhvnvncnccm
and I would like it to come out in the form
>1
akdfvcnciejcndmdjfk
>2
kdjkkkifjeeeeelfjfuf
>3
fjfhchdejhfhfhfhfhfhf (3 Replies)
Discussion started by: viored
3 Replies
4. Shell Programming and Scripting
Hi
I have below script which is used to grep specific errors and if error string matches send an email alert.
Script is working fine , however , i wish to print next 10 lines of the string match to get the details of error in the email alert
Current code:-
#!/bin/bash
tail -Fn0 --retry... (2 Replies)
Discussion started by: neha0785
2 Replies
5. Shell Programming and Scripting
In Bash using AWK or sed I need to convert the following file:
...
numitem_tab0 =<p>1 KEYWORD</p><p>2 KEYWORD</p><p>3 KEYWORD</p><p>4 KEYWORD</p><p>5 KEYWORD</p>...<p>25 KEYWORD</p>
subitem_tab0 =<p></p><p></p>
...
numitem_tab6 =<p>1 KEYWORD</p><p>2 KEYWORD</p><p>3 KEYWORD</p><p>4 KEYWORD</p>... (2 Replies)
Discussion started by: pioavi
2 Replies
6. Shell Programming and Scripting
This is a variation of an earlier post found here:
unixcom/shell-programming-scripting/159821-merge-two-non-consecutive-lines.html
User Bartus11 was kind enough to solve that example.
Previously, I needed help combining two lines that are non-consecutive in a file. Now I need to do the... (7 Replies)
Discussion started by: munkee
7 Replies
7. Shell Programming and Scripting
I am trying to search a file for a value: "Top 30 reject reasons" and want the next 30 lines after that and output in a text file.
If I knew the line number, I can use a combination of head and tail commands to get my results, but this doesn't seem to work when I don't have a line number.
I... (2 Replies)
Discussion started by: oriqin
2 Replies
8. Shell Programming and Scripting
I have a file with a list of config files numbered on the lefthand side 1-300. I need to have bash read each lines number and assign it to a variable so it can be chosen by the user called by the script later.
Ex. 1 some data
2 something else
3 more stuff
which number do you... (1 Reply)
Discussion started by: glev2005
1 Replies
9. Shell Programming and Scripting
Hi ,
I have file, which has the below content:
line 100
a
b
c
d
line300
a
s
d
f
s
line200
a
s
d
a (3 Replies)
Discussion started by: little_wonder
3 Replies
10. Shell Programming and Scripting
Dear friends, Please help me to resolve the problem below,
I have a file with following content:
date of file creation : 12 feb 2007
====================
= name : suresh
= city :mumbai
#this is a blank line
= date : 1st Nov 2005
====================
few lines of some text
this... (7 Replies)
Discussion started by: swamymns
7 Replies