Search Results

Search: Posts Made By: sigh2010
1,855
Posted By sigh2010
for the awk code Thanks for quick reply 2...
for the awk code
Thanks for quick reply
2 issues:

1)It made 0 into -0 which create and issue to process file
2) It is rounding the numbers. Can we keep the number or round to 2 decimals at...
1,855
Posted By sigh2010
change value to negative
How to change value in column 5 to negative based on value in column 2 ?
Example: For all records with A in column 2 change value in column 5 to negative.

file
Code:...
1,559
Posted By sigh2010
replace blank field in file 2 with content of file 1
Something like vlookup in excel, column 2 in file 2 is blank and should be replaced by column 2 in file 1 based on comparing column 1 in both files.

file1

Code:...
6,254
Posted By sigh2010
awk compare column with date format
I have this code to compare columns 1 and 10 between file1 and file 2 and give me all records that match column 1 but dont match column 10

However column 10 is date format mm/dd/yy and awk cant...
2,997
Posted By sigh2010
the solution by yazu was correct. my system...
the solution by yazu was correct.
my system could not use awk properly, it is setup to use nawk

this worked
nawk -F~ 'NR==FNR{A[NR]=$1$16;next}$1$16!=A[FNR]' f1 f2
thanks
3,903
Posted By sigh2010
awk print non matching lines based on column
My item was not answered on previous thread as code given did not work

I wanted to print records from file2 where comparing column 1 and 16 for both files find rows where column 16 in file 1 does...
4,016
Posted By sigh2010
does not work...it ahows contents of both files ...
does not work...it ahows contents of both files

awk -F~ 'NR==FNR{A[NR]=$1$16;next}$1$16!=A[FNR]' f1 f2...
4,016
Posted By sigh2010
file 1 ...
file 1

123456789~col2~col3~col4~col5~col6~col7~col8~col9~col10~col11~col12~col13~col14~col15~10/15/10...
4,016
Posted By sigh2010
Compare columns 2 files and print
File 1 has 16 columns so does File 2
I want to remove all records from File 2 that column 1 and column 16 match between file 1 and file 2
delimter of files is ~
2,997
Posted By sigh2010
alex you did not give alternative solution...
alex

you did not give alternative solution to the code.
Do you have one?

The awk solution did not work wither
2,997
Posted By sigh2010
lines 789, 3445, 678, 901 have matching values in...
lines 789, 3445, 678, 901 have matching values in column 6 and therefore should not be in file 3

lines with 012 have been corrected to have 6 fields, it was typo
2,997
Posted By sigh2010
file 1 ...
file 1


123~blah~static~abc~static~7/29/2010
456~blah~static~def~static~1/13/2011
789~blah~static~ghi~static~9/10/2009
012~blah~static~jkl~static~11/10/2010...
2,997
Posted By sigh2010
but this takes into account identical matching...
but this takes into account identical matching records not being printed.
The records are not exact duplicates but records have duplicate values in certain columns. So how can i have it compare the...
2,997
Posted By sigh2010
awk print only select records from file2
Print only records from file 2 that do not match file 1 based on criteria of comparing column 1 and column 6

Was trying to play around with following code I found on other threads but not too...
1,722
Posted By sigh2010
More specifically 5 columns in file 1 ...
More specifically

5 columns in file 1
11 columns in file 2
file 1 has more lines than file 2
cols 1, 2, 4, 5, 6, 7 match info between the two files

based on the matching cols (1,2,4,5,...
1,722
Posted By sigh2010
pick columns
I want to be able pick columns from 2 files with similar reference data:

File 1

Last NameFirst NameSalaryCityDunnJohn $42,000.00 ChicagoGrantSuzy $95,000.00 GaryLoweMike $80,000.00...
2,012
Posted By sigh2010
comparing lines in file
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...
2,361
Posted By sigh2010
no good...neither code worked... here is the...
no good...neither code worked...

here is the contents of the file 15.5
15.8
16.05
16.29
16.14
16.25
16.34
16.4
15.9
15.3
14.7
14.2
13.3
12.6
12.1
11.7
11.3
11.5
2,361
Posted By sigh2010
moving text within file
I want to mvoe lines around in a file.
Say I have 30 lines in a file and want to move the last 5 lines to the top of the file..how can this be done?
i thought of awk and sed but was not sure...
2,533
Posted By sigh2010
loop doesnt work
It just does the break...even though the files are not the same...


# Compare extracts
#==========================================

count=0
while (( count < 5 ))
...
1,758
Posted By sigh2010
unfortuately the sed one line turns data into...
unfortuately the sed one line turns data into whole numbers too..

e.g

file 1

had 937.0

with sed one liner"

file 2 becomes

937.

hence the diff flags it


anyone...
3,604
Posted By sigh2010
perfect...thanx :)
perfect...thanx :)
3,604
Posted By sigh2010
Can someone assist please? :)
Can someone assist please? :)
3,604
Posted By sigh2010
while loop with 3 ifs
im messing up somehwere...and can't seem to clean up the script...for it to work

objectives:

1. check for today's file, and sleep 30 secs between retries
2. only allow 5 tries before script...
1,758
Posted By sigh2010
thanks that was it...
thanks that was it...
Showing results 1 to 25 of 37

 
All times are GMT -4. The time now is 08:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy