10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I would like to write a /bin/ksh script to manipulate a file and compare its contexts. Comparing lines 1 & 2, 3 & 4, 5 & 6, and so forth until the end of the file. This is what I would like the script to compare (using line 1 & 2 as an example):
1. Verify if the last column in line 1 is... (10 Replies)
Discussion started by: seekryts15
10 Replies
2. Shell Programming and Scripting
Hello,
I've been working on a bash script to parse through firewall logs (cisco). I'm nearing the end and have a dilemma.
My data looks as such (actual data is several gigs worth of logs - without the headers):
sourceIP destinationIP destinationProtocol destinationPort
1.1.1.1 2.2.2.2 ... (2 Replies)
Discussion started by: umang2382
2 Replies
3. UNIX for Dummies Questions & Answers
Hi
I have 2 files which are tab delimited.
file1
chr1 5 10 P1 KR4
chr1 10 20 1H LA1 R0 TA1
file2
P1 G6 13.27 0.2425
P1 KR4 18.79 0.3060
P1 DND1 19.44 0.2833
N1 DH1 0.99 1.08
1H R0 0.9 NA
LA1 R0 90 0.9
TA1 KR4 1.8 8.9
TA1 R0 9.7 99I want to check whether first 2 columns in file2 (column... (1 Reply)
Discussion started by: raj_k
1 Replies
4. Shell Programming and Scripting
Hi everyone
I have a question for you, as I am trying to learn more about Perl and work with some weather data. I have an ascii file (shown below) that has 10 lines with different columns. What I would like is have Perl find an "anomalous" value by comparing a field with the values from the last... (2 Replies)
Discussion started by: lucshi09
2 Replies
5. Shell Programming and Scripting
Hello I'm having a little difficulty in writing a shell script for a few simple tasks.
First I have two files "file1.txt" and "file2.txt" and I want to read and compare the last line of each file. The files look like this.
File1.txt
File2.txt
After comparing the two lines I would... (2 Replies)
Discussion started by: RustikGaming
2 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I have a value stored in x and I need to compare it to the numbers in every other line of a file. The file contains alternating lines of numbers and letters:
aaaa1111
AAAAAAAA
bbbb2222
BBBBBBBB
cccc3333
CCCCCCCC
I need to compare x to the numbers in every other line without the... (2 Replies)
Discussion started by: ShiGua
2 Replies
7. Shell Programming and Scripting
Hi,
I have two files with below data::
file1:-
123|aaa|ppp
445|fff|yyy
999|ttt|jjj
555|hhh|hhh
file2:-
445|fff|yyy
555|hhh|hhh
The records present in file1, not present in file 2 should be writtent to the out put file.
output:-
123|aaa|ppp
999|ttt|jjj
Is there any one line... (3 Replies)
Discussion started by: gani_85
3 Replies
8. Shell Programming and Scripting
i have 2 files and i want to compare
i currently cat the files and awk print $1, $2 and doing if file1=file2 then fail, else exit 0
what i want to do is compare values, with column 1 being a reference i want to compare line by line and then still be able to do if then statement to see if worked... (1 Reply)
Discussion started by: sigh2010
1 Replies
9. Shell Programming and Scripting
Hi ,
I am currently using the while loop in bash shell, as follows.
while read line
do
echo $line
done < file.txt
However, i want to use the while loop on file.txt, which will read the file with 4 lines of gap.
Ex- if file.txt is a file of 100 lines, then i want to use the loop such... (3 Replies)
Discussion started by: jitendriya.dash
3 Replies
10. Shell Programming and Scripting
Hi,
I have 2 files
file1
********
01-05-09|java.xls|
02-05-08|c.txt|
08-01-09|perl.txt|
01-01-09|oracle.txt|
********
file2
********
01-02-09|windows.xls|
02-05-08|c.txt|
01-05-09|java.xls|
08-02-09|perl.txt|
01-01-09|oracle.txt|
******** (8 Replies)
Discussion started by: shekhar_v4
8 Replies