I need help with extracting data from a large file ~900mb. Below is how the data looks like, line number value
1001 10000
... ...
5001 50000
6001 60000
... ...
10001 100000
... ...
100001 1000000
basically i need to grep lines starting from line 1001 and keep grepping line data for every 1000 after that. this is because after a certain number of lines ******** is displayed for the values which is problematic for my usual grepping scheme and hence my need to use the grep line number method. any help on the command for doing this would be much appreciated
i have used the following code previously,
less a.dat | grep ".[0-9][0-9][0-9]0000..." > x.dat
which had worked very well previously but now need to take line number into consideration. is there a command similar to this?
i would like the bold part to be kept as 0000 and the remaining part before the zeroes to increment as usual [0-9]...
unfortunately did'nt work, but maybe useful code needing a bit of a tweak. thanks anyway.
Hello Everyone.
I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below:
if ; then
if ; then
tail +$1 $3 | head -n $2
else
... (5 Replies)
I want to grep out a part of a snort rule based on the SID given, but all i want as the output is the part in the quotes after the msg: An example line looks something like this:
alert tcp any any -> 127.0.0.1 any (msg:"Example Message"; classtype:Example; sid:123456;)
I would want it to... (7 Replies)
Hi,
I need a regular expression grepping all lines starting with '*' followed by a VARIOUS number of blanks and then followed by the string 'Runjob=1'.
I tried that code, but it doesn't work:
grep -i '*'+'Runjob=1' INPUT_FILE >>OUTPUT_FILE
Can someone help me?
Thanks (8 Replies)
I've got this command that I've been using to find strings on the same line, say I'm doing a search for name:
find . -name "*" | xargs grep -i "Doe" | grep -i "John" > output.txt
This gives me every line in a file that has John and Doe in it. I'm looking to add a OR operator for the second... (5 Replies)
Hi,
I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers.
To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
I've got a file which I am reading line by line (using read line) into a variable.
I then want to do a grep on that line to check for something. I've tried a number of methods none of which seem to work.
I thought I had it with the code below but for some reason it doesn't like it and comes... (4 Replies)
I have a pattern::
xldn3176bap>arj SOCRATES_MAIN_LNX | grep " FA "
10/04/2007 21:01 10/04/2007 21:01 FA 1776752/1 1
I want the line above this line and the line below it too. Can anyone tell me how it can be done?
- iAm4Free (4 Replies)
Having problem in using the grep command to select all possible combinations a number in a file. Example: 123, I would like to grep the numbers 123,132,213,231,312 and 321. (2 Replies)
Ok heres the situation.
I'm grepping for all running processes with the name system. but there are also processes running with the name systema. How do I just search for processes running just under the "system" user
Thanks in advance (1 Reply)