I've got a very peculiar situation. I'm trying to find out if we can compare null fields with non-null. I've output csv files from SQL and Oracle. I need to compare each field from the files, and then find out any differences. The files usualy have over 500 fields, and send the resule to DBA.... (8 Replies)
Hi,
i wrote If Conditions in my script, it's returns null and some values.
but i am unable to find when Null value getting. bec we need modification according null vales.
pls help me on this. (2 Replies)
I have a fixed width text file which has some null characters in no particular order. I need to replace them with spaces so that the width remains same.
I tried this:
tr "\000" "\040" < mainfile > newfile
Does not work. I tested that it works the other way round:
$ echo "hello" |tr... (1 Reply)
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)
Hi all,
Is there a way to perform the above, I am trying to strip out more than one space from a line, but keep the single space. See below output example.
My Name is test test2 test3 test4 test5
My Name is test test2 test3 test4 test5
Please note that the lines would contain... (7 Replies)
How to replace null with space?
I want to make each line with 80 characters. If any line contains only 5 characters and remaining is null, then i want to make it as 80 characrets where 5 is original characters and remaining 75 characters will be null..
NULL can come in between the line,... (3 Replies)
Hello,
I need to run a command or shell script that will compare 2 file with Condition.
Can you please help ?
thank you.
File 1.
############start@linda22 ... ##################
aaaaaaa
bbbbbbb
cccccc
dddddd
eeeee
11111
############start@linda23 ... ##################
aaaaaaa... (2 Replies)
i have this code
for i in `cat sql_output.txt`
do
-- some script commands
done
sql_output.txt has 1 column with employee_ids
If the sql_output.txt is null then the do loop should not execute.
How can i implement this.
for i in `cat sql_output.txt`
If i is null or empty
then ... (5 Replies)
Guys,
Please help me on the below
sample.cfg
var=NULL
sample.sh
#!/bin/sh
. /sample.cfg
if ;then
1 st command here
else
2 nd command here
fi (3 Replies)
Hi,
We receive flat files with fixed width data
Now our goal is append from right null or space to each record if the lenght of the record is less than for example 10.
for example
123 45 6 0
123 45
123 45 6
123
and output should be
123 45 6 0
123 45****
123 45 6**... (7 Replies)
Discussion started by: shharrath
7 Replies
LEARN ABOUT OSF1
gets
gets(3) Library Functions Manual gets(3)NAME
gets, fgets - Get a string from a stream
LIBRARY
Standard C Library (libc.so, libc.a)
SYNOPSIS
#include <stdio.h>
char *gets(
char *string);
char *fgets(
char *string,
int n,
FILE *stream);
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
gets(), fgets(): XPG4, XPG4-UNIX
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
Points to a string to receive bytes. Specifies an upper bound on the number of bytes to read. Points to the FILE structure of an open
file.
DESCRIPTION
The gets() function reads bytes from the standard input stream, stdin, into the array pointed to by the string parameter. Data is read
until a newline character is read or an end-of-file condition is encountered. If reading is stopped due to a newline character, the newline
character is discarded and the string is terminated with a null byte.
The fgets() function reads bytes from the data pointed to by the stream parameter into the array pointed to by the string parameter. Data
is read until n-1 bytes have been read, until a newline character is read and transferred to string, or until an end-of-file condition is
encountered. The string is then terminated with a null byte.
NOTES
The gets() function does not check the input for a maximum size. Consequently, if more bytes are entered than will fit in the space allo-
cated for the string parameter, gets() will write beyond the end of the allocated space, producing indeterminate results. To avoid this
condition, use fgets() instead of gets().
RETURN VALUES
Upon successful completion, the gets() and fgets() functions return string. If the stream is at end-of-file, the end-of-file indicator for
the stream is set and a null pointer is returned. If a read error occurs, the error indicator for the stream is set, a null pointer is
returned, and errno is set to indicate the error.
ERRORS
The fgets() and gets() functions set errno to the specified value for the following conditions: The O_NONBLOCK flag is set for the underly-
ing stream and the process would be delayed by the read operation. The file descriptor underlying the stream is not a valid file descrip-
tor or is not open for reading. The read operation was interrupted by a signal which was caught and no data was transferred. The call is
attempting to read from the process's controlling terminal and either the process is ignoring or blocking the SIGTTIN signal or the process
group is orphaned. Insufficient memory is available for the operation. The device associated with stream does not exist.
RELATED INFORMATION
Functions: clearerr(3), feof(3), ferror(3), fgetws(3), fileno(3), fopen(3), fputws(3), fread(3), getc(3), getwc(3), puts(3), scanf(3)
Standards: standards(5) delim off
gets(3)