08-25-2014
Quote:
Originally Posted by
RudiC
What have you tried so far? And, why didn't you select lines 1 and 2 from your input file, but lines 2 and 3 instaed?
The input file is sorted by transaction (T1,T2,T3) and datetime.
There are 2 records tied to 1 transaction (start and end).
As there is no end transaction for the first line, it will not be written in the output file.
I am thinking of using awk, but not very sure how to write it.
This User Gave Thanks to chailee For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I am newcomer and sorry for this simple question. I want to how to compare two lines in a file? For example, to compare the first line and the second line of a file to know if they are same?
Thanks in advance!
Leon (3 Replies)
Discussion started by: sabertooth2000
3 Replies
2. Shell Programming and Scripting
Hi, I want to compare the last two lines of a files, specifically characters 32 - 50 in both lines and generate an exit code if the range of characters do not match. Please advise. Thanks in advance! (2 Replies)
Discussion started by: limshady411
2 Replies
3. Shell Programming and Scripting
how to compare two lines using shell script? (1 Reply)
Discussion started by: suman_dba1
1 Replies
4. Shell Programming and Scripting
I need a simple script to parse a file with this data in it and have that script output a warning when CurrCapacity is more that 50% of MaxCapacity for a given pool Name, can anyone help ?
CurrCapacity: 5
MaxCapacity: 20
Name: fhlwDSource
CurrCapacity: 5
... (3 Replies)
Discussion started by: init0
3 Replies
5. Shell Programming and Scripting
Hi everybody,
I have a file that looks like:
A B C D -1 0
E F G H -2 0
I J K L +1
M N O P -6
I would like to compare $5 of every line. If both values are negative, I calculate a mean value and write the first line and delete the second one. If the two $5 values are different only... (6 Replies)
Discussion started by: s-layer
6 Replies
6. Shell Programming and Scripting
Hey guys I am having a problem with being able to find unused profiles in a configuration check script I am trying to create for accountability purposes for managing a large number of systems. What I am trying to do is run a script that will look at the raw config data in a file and pull all the... (3 Replies)
Discussion started by: scottzx7rr
3 Replies
7. Shell Programming and Scripting
could someone write a short script which is able to take a text file input and compare lines 1 and 2, 3 and 4, 5 and 6 ... ... until the end of the file. And to prompt if the lines are not equal.
Thank you! (10 Replies)
Discussion started by: c_lady
10 Replies
8. Shell Programming and Scripting
Hi Folks,
I need to compare the cron's timings from a text file. Need to display how much time does it took for that job.
For example i have the below txt file, I have cron1 started at 05:23:15 and completed at 05:25:57, now i need to find how much time did it took to complete corn1 job for... (8 Replies)
Discussion started by: Sendhil.Kumaran
8 Replies
9. Shell Programming and Scripting
I have a file lets say input.csv having two columns like-
Name,Mobile No
A,111
B,222
A,333
A,123
B,213
I would like to find result in a new file lets say output.csv as-
Name,Mobile No
A,111
B,222
means short the file on the basis of first column and first value corresponding to the... (5 Replies)
Discussion started by: Ashish Singhal
5 Replies
10. Shell Programming and Scripting
HI,
I have 2 text files. file1 and file2.
file1.txt (There are no duplicates in this file)
1234
3232
4343
3435
6564
6767
1213
file2.txt
1234,wq,wewe,qwqw
1234,as,dfdf,dfdf
4343,asas,sdds,dsds
6767,asas,fdfd,fdffd
I need to search each number in file1.txt in file2.txt's 1st... (6 Replies)
Discussion started by: Little
6 Replies