Total UNIX Rookie, but I'm learning. I have columns of integer data separated by spaces, and I'm using a Mac terminal.
What I want to do:
1. Compare "line 1 column 2" (x) to "line 2 column 2" (y); is y-x>=100?
2. If yes, display difference and y's line number
3. If no, increment x and y by one and repeat
How I am going about it:
Where do I go from here?
Your step 3 makes no sense to me. If y-x is not >= 100, then (y+1)-(x+1) can't be >= 100 either. This will just create an very large loop until one of the values overflows. So, until you can explain why this should be done, I'm going to ignore this requirement.
The proposal elixir_sinari makes the assumption that you are only comparing x values on odd numbered lines against y values on even numbered lines. Seeing your sample data and comments in message #6 in this thread, it looks like you want to compare the value in the 2nd column of your input file for every line except the 1st.
This slight modification to elixir_sinari's proposal:
produces the output:
with your sample data. Is this what you wanted?
This User Gave Thanks to Don Cragun For This Post:
I have a list of files that I want to compare to another list of files, how do I do that?
The first list will be my known list and hard coded, for example:
mylist="janfile.tar jarfile.jar jan.rpt.Z" etc.
The second list will be found by doing an 'ls' piped to a file:
ls > filelist.dat
... (4 Replies)
Hi Friends,
I have 2 files A and B . I want to compare the 3rd line of file A and B .
(I dont want to compare the 2 files, using diff or cmp). I just want to know whether 3rd line of A matches the 3 rd line of B. Can anybody share their knowledge on the same?
Thanks ,
Vijaya (12 Replies)
Hi Everyone,
I will try to explain my question please forgive my english here.
I am looking for shell script or command that can compare data in the files.
I have 50 files in one directory test1 test2 test3 ....so on.
I want to compare data in each files with each other and output each... (4 Replies)
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)
Hello,
Please help me with this problem if you have a solution.
I have two files:
<file1> : In each line, first word is an Id and then other words that belong to this Id
piMN-1 abc pqr xyz py12
niLM y12 FY4 pqs
fiRLym F12 kite red
<file2> : same as file1, but can have extra lds... (3 Replies)
Hi,
I have one file, say file 1, that has data like below where 19900107 is the date,
19900107 12 144 129 0.7380047
19900108 12 168 129 0.3149017
19900109 12 192 129 3.2766666E-02
... (3 Replies)
Hi Friends,
I have a file 1
CREATE MULTISET TABLE TEYT_Q9_T.TEST ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT,
DEFAULT MERGEBLOCKRATIO
(
XYZ DECIMAL(10,0),
ABC VARCHAR(5) CHARACTER SET LATIN NOT CASESPECIFIC,
PQR... (3 Replies)
# cat list.txt
server1
server2
server3
server4
# data to be compared of.
#dns address
1.1.1.1
2.2.2.2
3.3.3.3
#for i in `cat list.txt`
do
grep dns $ i
done (1 Reply)
Hello all- New to this forum, and relatively new to using grep at the Terminal command line to work with regular expressions. I've got a background in math and some programming experience, so it's not been too difficult to learn the basics of searching through my word lists for particular types of... (13 Replies)
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
LEARN ABOUT DEBIAN
gltron
GLTRON(6) Games Manual GLTRON(6)NAME
gltron - a tron-like 3D lightcycle game
SYNOPSIS
gltron [[-FftwbghcCsk1234simo]
DESCRIPTION
glTron is a tron-like lightcycle game with a nice 3D perspective 3D acceleration is recommended.
More information can be found at the gltron web site http://www.gltron.org/
PROBLEMS
If the game refuses to start up, check your hardware settings and that the necessary libraries are installed.
If the options are messed up, remove ~/.gltronrc and try again.
Anything else check TODO, known bugs on the website, and lastly ask in #gltron on irc.freenode.net.
OPTIONS
Valid command line options:
-O enable software optimizations, useful if your card doesn't have OpenGL acceleration. For best results combine with -t and -1.
-f fast finish after human has crashed
-F don't display FPS counter
-t don't display floor texture, use lines instead (huge speed gain)
-w don't display walls (speed gain)
-x don't show crash texture (speed gain)
-g don't show glows (small speed gain)
-c don't show ai status
-C show ai status (default: on)
-1 set resolution to 320x240
-2 set resolution to 640x480 (default)
-3 set resolution to 800x600
-4 set resolution to 1024x768
-s don't play sound
-h help
AUTHOR
Updated with PROBLEMS section by Countersync <countersync@hotmail.com> before submission to upstream source.
This manual page was written by Jeronimo Pellegrini <pellegrini@mpcnet.com.br>, based on the information in the package by Raphael
Bossek, for the Debian GNU/Linux system (but may be used by others).
2001-06-10 GLTRON(6)