Extract string from multiple file based on line count number
Hi,
I search all forum, but I can not find solutions of my problem
I have multiple files (5000 files), inside there is this data :
FILE 1:
FILE 2:
FILE 3:
I need to extract this data so that result in another single file (call it result.txt) will be :
I am truly newby with awk/perl,
Any helps are very much appriciated.
Gunk.
Last edited by Franklin52; 04-04-2011 at 09:14 AM..
Reason: Please use code tags
I need to count the number of files which have a search string, but counting the file only once
if search string is found.
eg: File1: Please note that there are 2 occurances of "aaa"
aaa
bbb
ccc
aaa
File2: Please note that there are 3 occurances of "aaa"
aaa
bbb
ccc... (1 Reply)
I have a shell script and want to assign a value to a variable. The value is the line exctrated from a file using the line number. The line number it is not fix, and could change any time.
I have tried sed, awk, head .. See my script
# Get randome line number from the file
#selectedline = `awk... (1 Reply)
Hello,
I am having trouble extracting a specific line from a file when the line number is known. My first attempt involved grep -n 'hi' (the word 'hi will always be there) to get the line number before the line that I actually want (line 4).
Extra Notes:
-I am working in a bash script.
-The... (7 Replies)
Hello People,
I have the following contents in an XML file
...........
...........
..........
...........
<Details = "Sample Details">
<Name>Bob</Name>
<Age>34</Age>
<Address>CA</Address>
<ContactNumber>1234</ContactNumber>
</Details>
...........
.............
.............. (4 Replies)
Hello everybody!
I am quit new here and hope you can help me.
Using an awk script I am trying to extract data from several files. The structure of the input files is as follows:
TimeStep parameter1 parameter2 parameter3 parameter4
e.g.
1 X Y Z L
1 D H Z I
1 H Y E W
2 D H G F
2 R... (2 Replies)
Gurus,
Need little guidance.
I have A.txt and B.txt file. B.txt file contains Unique strings.
Sample content of B.txt file for which i cut the fourth column uniquely and output directed to B.txt file
And A.txt file contains the above string as a fourth column which is last column.
So A.txt... (7 Replies)
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)
I have a LOG file which looks like this
Import started at: Mon Jul 23 02:13:01 EDT 2012
Initialization completed in 2.146 seconds.
--------------------------------------------------------------------------------
--
Import summary for Import item: PolicyInformation... (8 Replies)
if there's a file containing:
money king money queen money cat money also money king
all those strings are on one line in the file.
how can i find out how many times "money king" shows up in the line?
egrep -c "money king" wont work. (7 Replies)
Discussion started by: SkySmart
7 Replies
LEARN ABOUT CENTOS
abrt-dump-oops
ABRT-DUMP-OOPS(1) ABRT Manual ABRT-DUMP-OOPS(1)NAME
abrt-dump-oops - Extract oops from FILE (or standard input)
SYNOPSIS
abrt-dump-oops [-vusoxtm] [-d DIR]/[-D] [FILE]
DESCRIPTION
This tool creates problem directory from, updates problem directory with or prints oops extracted from FILE or standard input.
OPTIONS -v, --verbose
Be more verbose. Can be given multiple times.
-s
Log to syslog
-o
Print found oopses on standard output
-d DIR
Create new problem directory in DIR for every oops found
-D
Same as -d DumpLocation, DumpLocation is specified in abrt.conf
-u PROBLEM
Save the extracted information in PROBLEM directory
-x
Make the problem directory world readable. Usable only with -d/-D
-t
Throttle problem directory creation to 1 per second
-m
Print search string(s) for abrt-watch-log to stdout and exit
SEE ALSO abrt-watch-log(1), abrt.conf(5)AUTHORS
o ABRT team
abrt 2.1.11 06/18/2014 ABRT-DUMP-OOPS(1)