Sponsored Content
Full Discussion: Printing null values in awk
Top Forums Shell Programming and Scripting Printing null values in awk Post 302985095 by MadeInGermany on Friday 4th of November 2016 05:25:27 PM
Old 11-04-2016
Adding some debug code to your original script
Code:
#!/bin/ksh
debugfile=debug.txt
while read line
do
  echo "$line" |
   awk -F"," '{print $1" "$2" "$3" "$4" "$5}' |
   tee -a $debugfile |
   read dbt_acct val_dt crncy AMT dbt_GOP
  print "$AMT"
done <abc.txt

Now look at the debug.txt file, and you should see the problem!
Code:
123 ra point  there
232 ba points home pheer

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to Compare Null values??

Hi, Can someone help me comparing Null values. Scenario is as follows: I have a variable which "cache_prd" which can have either some integer or nothing(Null) if it is integer I have to again do some comparision but these comparisons give me this error:( "line 32: [: 95: unary operator... (3 Replies)
Discussion started by: Yagami
3 Replies

2. Shell Programming and Scripting

sorting null values

Hi I have a file with the values abc res set kls lmn ops i want to sort this file with the null values at the bottom of the file OUTPUT should look like this abc kls lmn ops (6 Replies)
Discussion started by: vickyhere
6 Replies

3. Shell Programming and Scripting

How to use sort with null values?

Hello everyone I am doing a join command. Obviously, before I need two files sorted first. ( Both files have headers and have about 2 million lines each one ) The problem is, one of the files has null values in the key to sort (which is the first filed ). For example I have the original... (4 Replies)
Discussion started by: viktor1985
4 Replies

4. Shell Programming and Scripting

Perl: Printing null hash values as a " "?

I'm filling in a table of values for grades. I decided to go with reading into a hash from the files but I'm coming up with an error when printing a value that does not exist. I need to know if I can on-the-fly print a space (" ") or blank in place of the grade. Here's what the output should... (2 Replies)
Discussion started by: D2K
2 Replies

5. Shell Programming and Scripting

Handle null values-awk

I am using below code to validate the source file,code working fine but if any column contains null value then below code throwing error actually it should not.how to customize the below code to handle null null values also. When I run the script with below source data getting “date error”, as... (2 Replies)
Discussion started by: srivalli
2 Replies

6. Programming

NULL printing a value 0xbf940000 and not a zero

hello all, in the following code a -> next should print zero, but it is giving the output as 0xbf940000 #include<iostream.h> #include<conio.h> #include<stdio.h> class Node { public: int data; Node *next; Node(int n=1) { data=10; next=0; } }; void main()... (3 Replies)
Discussion started by: zius_oram
3 Replies

7. Shell Programming and Scripting

Awk: Comparing arguments with in line values of file and printing the result

I need to develop a script where I will take two date arguments as parameter date1 and date2 which will in format YYYYMM. Below is the input file say sample.txt. sample.txt will have certain blocks starting with P1. Each block will have a value 118,1:TIMESTAMP. I need to compare the... (7 Replies)
Discussion started by: garvit184
7 Replies

8. Shell Programming and Scripting

Printing $values using awk

Hi All I had requirement where I need to re-order columns in a file by using a control file. here is the ctrl file c1 c2 c3 source file c3 | c1 | c2 a | b| c I should create output file based on the ctrl file columns o/p should look like this c1 | c2 | c3 b| c|a I wrote some... (9 Replies)
Discussion started by: gvkumar25
9 Replies

9. Shell Programming and Scripting

Replace null values with dot using awk

Using awk I am trying to replace all blank or null values with a . in the tad delimited input. I hope the awk is close. Thank you :). input name test sam 1 liz 2 al 1 awk awk 'BEGIN{FS=OFS="\t"}{for(i=1;++i<NF;)$i=$i?$i:"."}1'input awk 'BEGIN { FS =... (6 Replies)
Discussion started by: cmccabe
6 Replies

10. Shell Programming and Scripting

Count null values in a file using awk

I have the following a.txt file A|1|2|3|4|5| A||2|3|0|| A|1|6||8|10| A|9|2|3|4|1| A|0|9|3|4|5| A||2|3|4|5| A|0|av|.9|4|9| I use the following command to count null values for 2nd field awk -F"|" '!$2 { N++; next } END {print N}' a.txt It should give the result 2, but it is giving... (2 Replies)
Discussion started by: RJG
2 Replies
GOMOKU(6)							 BSD Games Manual							 GOMOKU(6)

NAME
gomoku -- game of 5 in a row SYNOPSIS
gomoku [-bcdu] [-D debugfile] [savefile] DESCRIPTION
gomoku is a two player game where the object is to get 5 in a row horizontally, vertically or diagonally on a 19 by 19 grid. By convention, black always moves first. The options are: -b Run in batch mode. (See below.) -c Computer versus computer. gomoku will play a game against itself. This is mostly used for testing. -d Print debugging information. Repeating this option more than once yields more detailed information. -D debugfile Print the debug information to debugfile instead of to the standard output. -u User versus user. (Play against yourself.) This is mostly used for testing. savefile Load a previously saved game from savefile. With no arguments, gomoku starts a fresh user vs. computer game. Moves may be entered by selecting the desired board location and pressing the space or enter key. The cursor may be moved using the arrow keys or vi(1) motion keys hjklyubn. These also may be familiar from rogue(6) and hack(6). To quit, type 'Q', and to save the game, type 'S' and supply a file name when prompted. Batch mode Batch mode was intended for game tournaments where a referee program handles the board display and pits one program against another. In this mode, gomoku reads moves from standard input and writes its responses to standard output. The first line of input should be either ``black'' or ``white'' to specify whether gomoku has the first move or not respectively. AUTHORS
Ralph Campbell ACKNOWLEDGEMENTS
The board display routines were based on the goref program written by Peter Langston. The user interface was based on Eric S. Raymond's interface for bs. BSD
March 28, 2010 BSD
All times are GMT -4. The time now is 04:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy