10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I am trying to find out the line numbers where regex match and put them into a file with below command:
awk '/'$pat'/ {print NR}' $fileName >> temp.txt
where $pat is the regex
but this command is taking a lot of time to execute with bigger files for size more than 5000000... (8 Replies)
Discussion started by: JoeColeEPL9
8 Replies
2. Shell Programming and Scripting
Hi all,
I have a simple problem. I have given an example of the problem below.
There are 4 space-delimited columns.
2655 96 IA -0.8179
2655 96 IA -0.9144
2655 96 CPU -0.4275
2655 96 RMA -0.3407
2655 96 IA -0.9373
2655 96 ... (2 Replies)
Discussion started by: jaysean
2 Replies
3. Programming
Input file:
#data_1
AGDG
#data_2
ADG
#data_3
ASDDG
DG
#data_4
A
Desired result:
Highest 7
Slowest 1
code that I try but failed to archive my goal :(
#include <stdio.h> (2 Replies)
Discussion started by: cpp_beginner
2 Replies
4. Shell Programming and Scripting
Hi Frnds,
I need to find the line number of a particular line in a file and store that line number to a variable.
if a file named myfile contains following
look at the sun
look at the moon
look at the star
look at the ocean
i need to get the line number of the line 'look at the... (3 Replies)
Discussion started by: mvignesh
3 Replies
5. Shell Programming and Scripting
i have a problem i am working on and am completely new to bash commands. I writing a script to read another file and output the max and Min number in the script. I must use variables to output the max and min numbers. grades = file with numbers in them.
This is what i got so far. Thank You in... (3 Replies)
Discussion started by: ctanner10126
3 Replies
6. Shell Programming and Scripting
Hello All,
What i am doing is , i tail a file from certain chatacter and then cat -n to get the line numbers.I search for a particular string and gets it line number. What i am interested in is the next line immediately after the pattern i search.
But grep gives me result for all line... (5 Replies)
Discussion started by: kailash19
5 Replies
7. Shell Programming and Scripting
Hello
Wondering if anybody may be able to advise on how I can filter the contents of the following file:
<object_name>-<version> <Instance>
GM_GUI_code.fmb-4 1
GM_GUI_code.fmb-5 1
GM_GUI_code.fmx-4 ... (7 Replies)
Discussion started by: Glyn_Mo
7 Replies
8. Shell Programming and Scripting
Hi there
does anybody know how i can get the line number from an entry or entries in a file ?? for example if i had a file
test1
test2
test3
test1
and i needed to get the line numbers for all instances of test1 in that file
with the answer being (1,4)
Would anybody be able... (7 Replies)
Discussion started by: hcclnoodles
7 Replies
9. Shell Programming and Scripting
Hi,I am new to shell scripting and i want to find the line numbers of matching braces.
The file contents are as follows
File XXX.dat
1 ( CLASS "FRUIT"
2 (TYPE "PERSISTENT")
3 (MESSAGE_TYPE "M")
4 (GET_REQRD "Y")
5 (SET_REQRD "Y")
6 )
7 ( CLASS... (3 Replies)
Discussion started by: Rajendra_1510
3 Replies
10. Shell Programming and Scripting
Hi,
I have a file a.txt and it has values in it
Eg :-
I need to read through the file and find the number that is the greatest in them all.
Can any one assit me on this.
Thanks (30 Replies)
Discussion started by: systemali
30 Replies