Sponsored Content
Top Forums Shell Programming and Scripting Dropping Records for unknown reason in awk script Post 302367377 by mkastin on Monday 2nd of November 2009 11:08:38 AM
Old 11-02-2009
Quote:
Originally Posted by binlib
Is there a pattern for the missing records, e.g. at the end?
Since your output format is the same as the input, do
Code:
cmp -l infile outfile

Look for difference that doesn't look like your intended one. The expected difference is you replace blanks of input with fixed values on the output. Try to spot visually (or mechanically) the unintended differences.
I ran a diff on the files and I got over 160,000 lines returned I couldn't tell from this what lines went missing or if there was a discernible pattern to them. What I could tell from the diff was that appending the data onto the records I wanted to did work. I don't know if some of these records disappeared or if it was other fully intact lines.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

why my script stopped- any reason(urgent please)

Hi Friends, iam running some scripts, which are all off suddenly stopping. Can any one tell me the reason why it happend. Is there any reason to stop the scripts. Thanks Krishna. (1 Reply)
Discussion started by: krishna9
1 Replies

2. Shell Programming and Scripting

awk out an unknown column ?

I need a solution to awk out an unknown column. I am unable to say '{print $x}' because the location changes. I would like to find a perl or awk solution to this. I do not know either very well but am trying to delve deeper into both. I am looking for the version of pkg8 in this example. Please... (17 Replies)
Discussion started by: i9300
17 Replies

3. Shell Programming and Scripting

Finding out how long a script runs for and exit reason.

I am running a daemon program that sends texts via a connected mobile phone. I run this daemon via CLI, and it loops a few commands (checking to see if there are any new texts). It runs perfectly, the problem is, when I leave this to run on my Ubuntu Desktop, and come back to it hours later it... (2 Replies)
Discussion started by: daydreamer
2 Replies

4. Linux

Need awk script for removing duplicate records

I have huge txt file having millions of trade data. For e.g Trade.txt (first 8 lines in the file is header info) COB_DATE,TRADE_ID,SOURCE_SYSTEM_TRADE_ID,TRADE_GROUP_ID, TRADE_TYPE,DEALER_NAME,EXTERNAL_COUNTERPARTY_ID, EXTERNAL_COUNTERPARTY_NAME,DB_COUNTERPARTY_ID,... (6 Replies)
Discussion started by: nmumbarkar
6 Replies

5. Linux

Need awk script for removing duplicate records

I have log file having Traffic line 2011-05-21 15:11:50.356599 TCP (6), length: 52) 10.10.10.1.3020 > 10.10.10.254.50404: 2011-05-21 15:11:50.652739 TCP (6), length: 52) 10.10.10.254.50404 > 10.10.10.1.3020: 2011-05-21 15:11:50.652558 TCP (6), length: 89) 10.10.10.1.3020 >... (1 Reply)
Discussion started by: Rastamed
1 Replies

6. Shell Programming and Scripting

awk script for getting the selected records from a file.

Hello, I have attached one file named file.txt . I have to create a file using the awk script with the records in which 38th position is P and not V . ex it should have 00501 HOLTSVILLE NYP00501 and it should not include 00501 I R S SERVICE CENTER ... (3 Replies)
Discussion started by: sonam273
3 Replies

7. UNIX for Advanced & Expert Users

Unix script seems to be momentarily creating child process for unknown reason

Hi, I have a unix script that basically has a while loop inside which it checks Oracle database for certain records. If it finds the records, it does some processing and then goes back to the while loop. If it doesnot find any matching records, then it sleeps for 30 seconds and then goes back to... (17 Replies)
Discussion started by: waavman
17 Replies

8. Shell Programming and Scripting

Print Unknown Number of User Inputs in awk

Hello, I am new to awk and I am trying to figure out how to print an output based on user input. For example: ubuntu:~/scripts$ steps="step1, step2, step3" ubuntu:~/scripts$ echo $steps step1, step2, step3 I am playing around and I got this pattern that I want: ... (3 Replies)
Discussion started by: tattoostreet
3 Replies

9. Shell Programming and Scripting

awk to update unknown value in file using range of another

I am trying to use awk to update all the unknown values in $6 of file2, if the $4 value in file 2 is within the range of $1 of file1. If there is already a value in $6 other then unknown, it is skipped and the next line is processed. In my awk attempt below the final output is 6 tab-delimited... (6 Replies)
Discussion started by: cmccabe
6 Replies

10. Shell Programming and Scripting

SSH is failing due to unknown reason

Hi, I have setup keys between user1@server1 and user2@server2 however, the ssh is failing. server1 is Linux 3.10.0-514.6.2.el7.x86_64 #1 SMP whereas server2 is 5.10 Generic_150400-40 sun4v sparc sun4v I have checked port 22 to be open and keys to be correct. I also find the permissions... (3 Replies)
Discussion started by: mohtashims
3 Replies
ZDIFF(1)                                                      General Commands Manual                                                     ZDIFF(1)

NAME
zcmp, zdiff - compare compressed files SYNOPSIS
zcmp [ cmp_options ] file1 [ file2 ] zdiff [ diff_options ] file1 [ file2 ] DESCRIPTION
Zcmp and zdiff are used to invoke the cmp or the diff program on files compressed via gzip. All options specified are passed directly to cmp or diff. If only file1 is specified, it is compared to the uncompressed contents of file1.gz. If two files are specified, their con- tents (uncompressed if necessary) are fed to cmp or diff. The input files are not modified. The exit status from cmp or diff is pre- served. SEE ALSO
cmp(1), diff(1), zmore(1), zgrep(1), znew(1), zforce(1), gzip(1), gzexe(1) BUGS
Messages from the cmp or diff programs may refer to file names such as "-" instead of to the file names specified. ZDIFF(1)
All times are GMT -4. The time now is 05:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy