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
Hi
I want to use awk to match where field 3 contains a number within string - then print the line and just the number as a new field.
The source file is pipe delimited and looks something like
1|net|ABC Letr1|1530|||
1|net|EXP_1040 ABC|1121|||
1|net|EXP_TG1224|1122|||
1|net|R_North|1123|||... (5 Replies)
Discussion started by: Mudshark
5 Replies
3. Shell Programming and Scripting
Hi,
I have a file like below.
1,2,3,4,5,6,7,8,9I would like to print or copied to a file based of line count in perl
If I gave a condition 1 to 3 then it should iterate over above file and print 1 to 3 and then again 1 to 3 etc.
output should be
1,2,3
4,5,6
7,8,9 (10 Replies)
Discussion started by: Anjan1
10 Replies
4. Shell Programming and Scripting
Hi Guru's,
I am trying to grep a range of line numbers (based on match) and then look for another match which starts with a special character '$' and print the line number. I have the below code but it is actually printing the line number counting starting from the first line of the range i am... (15 Replies)
Discussion started by: Kevin Tivoli
15 Replies
5. Shell Programming and Scripting
Hi,
I have a file as below
This is the line one
This is the line two
<\XMLTAG>
This is the line three
This is the line four
<\XMLTAG>
Output of the SED command need to be as below.
This is the line one
This is the line two
<\XMLTAG>
Please do the need to needful to... (4 Replies)
Discussion started by: RMN
4 Replies
6. Shell Programming and Scripting
Hello all,
How can I find the lowest number every 10 lines? For example i have a list
name1
-0.1
name2
2
name3
3
name4
-3
name5
1
name6
2
name7
34
name8
34 (6 Replies)
Discussion started by: TheTransporter
6 Replies
7. Shell Programming and Scripting
Hi,
I want to print the line number with the pattern of the line on a same line using multi-patterns in sed.
But i don't know how to do it.
For example, I have a file
abc
def
ghi
I want to print
1 abc
2 def
3 ghi
I know how to write it one line code, but i don't know how to put... (11 Replies)
Discussion started by: ntpntp
11 Replies
8. Shell Programming and Scripting
Hi all,
This should be very easy but I can't figure it out...
I have a file that looks like this:
@SRR057408.1 FW8Y5CK02R652T length=34
AGCAGTGGTATCAACGCAGAGTAAGCAGTGGTAT
+SRR057408.1 FW8Y5CK02R652T length=34
FIIHFF6666?=:88@@@BBD:::?@ABBAAA>8
@SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
Discussion started by: kmkocot
1 Replies
9. Shell Programming and Scripting
Hi Unix gurus
Basically i am searching for the pattern and getting the line numbers of the grepped pattern. I am trying to print the series of lines from 7 lines before the grepped line number to the grepped line number.
I am trying to use the following code. but it is not working.
cat... (3 Replies)
Discussion started by: mohanm
3 Replies
10. Shell Programming and Scripting
Hello, I need help in appending the line number of each line to the file and also to get the total number of lines. Can somebody please help me.
I have a file say:
abc
def
ccc
ddd
ffff
The output should be:
Instance1=abc
Instance2=def
Instance3=ccc
Instance4=ddd
Instance5=ffff
... (2 Replies)
Discussion started by: chiru_h
2 Replies