04-07-2011
Need to combine counts from diff files
Ok i have a script that goes into the last 3 files, grabs a value from that file which is a date, counts the number of results of that date.
So this is the output:
FILED001.20110407.175709.086912
49995 04-07T12
4 04-07T07
1 04-07T17
FILED001.20110407.180111.086913
50000 04-07T12
FILED006.20110407.175229.081672
48939 04-07T12
626 04-06T21
427 04-06T20
6 04-07T11
2 04-07T07
FILED006.20110407.175316.081673
32721 04-06T21
8895 04-06T20
8383 04-07T12
1 04-06T16
But I want the output to combine the two files that have the same extension in the front so:
FILED001
FILED006
And add the numbers for each date.
so instead it would look like this:
FILED006
33347 04-06T21
9322 04-06T20
57322 04-07T12
6 04-07T11
2 04-07T07
1 04-06T16
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i need to combine two file. These two files have the same line number, and i need to combine each corresponding line. I tried the paste, but i need coma as the delimeter. are there anyway to do it? thanks. (4 Replies)
Discussion started by: tao
4 Replies
2. Shell Programming and Scripting
Hello,
I want to compare two files. All records in file 2 that are not in file 1 should be output to file 3.
For example:
file 1
123
1234
123456
file 2
123
2345
23456
file 3 should have
2345
23456
I have looked at diff, bdiff, cmp, comm, diff3 without any luck! (2 Replies)
Discussion started by: blt123
2 Replies
3. Shell Programming and Scripting
Hey all,
So I have this challenge where I am attempting to compare record counts from within several different log files. I want input and output counts for each file, and I want to compare that with the result of the input/output comparison from a separate--but related file.
Example:
... (2 Replies)
Discussion started by: gator76
2 Replies
4. Shell Programming and Scripting
I need to compare 2 diff type of files and find out the duplicate after comparing each types of files:
Type 1 file name is like: file1.abc
(the extension abc could any 3 characters but I can narrow it down or hardcode for 10/15 combinations).
The other file is file1.bcd01abc (the extension... (2 Replies)
Discussion started by: ricky007
2 Replies
5. Shell Programming and Scripting
Hi all,
what will be the code to compare count present in two seperate files
for e.g file (a) contains counts
100
and file (b) contains records
90
since both these files have differnt count so it will display count didnt match
and in case of success it display (5 Replies)
Discussion started by: jojo123
5 Replies
6. Shell Programming and Scripting
How do get the counts by excluding header and tailer.
wc -l customer_data*.0826
31 customer_data_1.0826
57 customer_data_2.0826
456 customer_data_3.0826
668 customer_data_4.0826
789 customer_data_5.0826
2344 customer_data_6.0826
13457 customer_data_7.0826... (6 Replies)
Discussion started by: zooby
6 Replies
7. Shell Programming and Scripting
I am trying to load data into 3 tables simultaneously (which is working fine). Then when loaded, it should count the total number of records in all the 3 input files and send an e-mail to the user.
The script is working fine, as far as loading all the 3 input files into the database tables, but... (3 Replies)
Discussion started by: msrahman
3 Replies
8. Shell Programming and Scripting
I have multiple files; each file contains a certain data in a column view
simply i want to combine all those files into one file in columns
example
file1:
a
b
c
d
file 2:
1
2
3
4
file 3:
G (4 Replies)
Discussion started by: ahmedamro
4 Replies
9. Shell Programming and Scripting
Guys i have 3 files,
but i want to compare and diff only the 2nd column
path=`/home/whois/doms`
for i in `cat domain.tx`
do
whois $i| sed -n '/Registry Registrant ID:/,/Registrant Email:/p' > $path/$i.registrant
whois $i| sed -n '/Registry Admin ID:/,/Admin Email:/p' > $path/$i.admin... (10 Replies)
Discussion started by: kenshinhimura
10 Replies
10. UNIX for Beginners Questions & Answers
i use the split command to split a one terabyte backup file into 10 chunks of 100 GB each. The files are split one after the other. While the files is being split, I will like to scp the files one after the other as soon as the previous one completes, from server A to Server B. Then on server B ,... (2 Replies)
Discussion started by: malaika
2 Replies
fwtmp(1M) fwtmp(1M)
NAME
fwtmp, wtmpfix - manipulate connect accounting records
SYNOPSIS
[files]
DESCRIPTION
fwtmp
reads from the standard input and writes to the standard output, converting binary records of the type found in to formatted ASCII records.
The ASCII version is useful to enable editing, via ed(1), bad records or for general purpose maintenance of the file.
The argument is used to denote that input is in ASCII form, and output is to be written in binary form. The arguments and are independent,
respectively specifying ASCII input and binary output. Therefor, is an ASCII to ASCII copy and is a binary to binary copy. should be used
for reading If is not used, structure is read.
wtmpfix
examines the standard input or named files in format, corrects the time/date stamps to make the entries consistent, and writes to the stan-
dard output. A can be used in place of files to indicate the standard input. If time/date corrections are not performed, will fault when
it encounters certain date-change records.
Each time the date is set, a pair of date change records is written to The first record is the old date denoted by the string old time
placed in the line field and the flag placed in the type field of the structure. The second record specifies the new date, and is denoted
by the string placed in the line field and the flag placed in the type field. uses these records to synchronize all time stamps in the
file. nullifies date change records when writing to the standard output by setting the time field of the structure in the old date change
record equal to the time field in the new date change record. This prevents and from factoring in a date change record pair more than
once.
In addition to correcting time/date stamps, wtmpfix checks the validity of the name field to ensure that it consists solely of alphanumeric
characters or spaces. If it encounters a name that is considered invalid, it changes the login name to and writes a diagnostic to the
standard error. This minimizes the risk that will fail when processing connect accounting records.
DIAGNOSTICS
wtmpfix generates the following diagnostics messages:
WARNINGS
generates no errors, even on garbage input.
FILES
SEE ALSO
ed(1), acct(1M), acctcms(1M), acctcom(1M), acctcon(1M), acctmerg(1M), acctprc(1M), acctsh(1M), runacct(1M), acct(2), acct(4), utmp(4),
wtmps(4).
STANDARDS CONFORMANCE
fwtmp(1M)