06-14-2005
Korn Shell Script - Read File & Search On Values
I am attempting to itterate through a file that has multiple lines and for each one read the entire line and use the value then to search in other files. The problem is that instead of an entire line I am getting each word in the file set as the value I am searching for. For example in File 1 instead of searching for "The UNIX World" my program searches for "The" and then "UNIX" and then "World".
File 1
The UNIX World
Words
Retro data is here somewhere
Quit it right now123
What I wrote was the following:
set -A Value_List `cat $1`
for item in ${Value_List[*]}
do
FOUNDIT=`grep $item $2`
if [ ! -z ${FOUNDIT} ]; then
echo "Not Found $item"
else
echo $item >> item.results
fi
done
Can someone help me get the rest of the way there?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have a file called Delete and within the delete file I have the following statement:
delete from employee where employee_id = " "
how do I write a script that read from this file and replace:
employee_id = " " with employee_id is null
Please assist...greatly... (3 Replies)
Discussion started by: kenix
3 Replies
2. Shell Programming and Scripting
Hello!!
I'm want to read each line of a file.
I'm doing a cut command, using \n - linefeed as delimeter and "list" as my file.
cut -f1 -d"\n" -s < list
Changing the file, putting spaces and doing cut -f1 -d" " -s < list it works, but with linefeed nothing is returned.
Thanks... (5 Replies)
Discussion started by: alienET
5 Replies
3. Shell Programming and Scripting
I have read another post about this issue and am wondering how to adapt it
to my own, much simpler, issue.
I have a file of user IDs like so:
333333
321321
546465
...etc
I need to take each number and use it to print records wherein the 5th
field matches the user ID pulled from the... (2 Replies)
Discussion started by: Bubnoff
2 Replies
4. Shell Programming and Scripting
I need to read data from a file called "test.csv" through shell script where the file contains values like name,price,descriptor etc. There are rows where descriptor (& in some rows name) are written as string & other characters like "car_+" OR "bike*" etc where it should contains strings like... (3 Replies)
Discussion started by: raj100
3 Replies
5. Shell Programming and Scripting
Enclosed is comma separated text file. I need to write a korn shell program that will parse the text file and insert the values into Oracle database.
I need to write the korn shell program on Red Hat Enterprise Linux server.
Oracle database is 10g. (15 Replies)
Discussion started by: shellguy
15 Replies
6. Shell Programming and Scripting
Hi ,
I am trying to write an shell, which reads a text file (from a location) having a list of numbers of strictly 5 digits only ex: 33144
Now my script will check :
1) that each entry is only 5 digits & numeric only, no alphabets, & its not empty.
2)then it executes a shell script called... (8 Replies)
Discussion started by: new_to_shell
8 Replies
7. Programming
this is my issue.
4 parameters are passed from korn shell to sql script.
parameter_1= varchar2 datatype or no value entered my user.
parameter_2= number datatype or no value entered my user.
parameter_3= number datatype or no value entered my user.
parameter_4= number datatype or no... (5 Replies)
Discussion started by: megha2525
5 Replies
8. Shell Programming and Scripting
For eg: I have sample.txt file with 4 rows of record like:
user1|password1
user2|password2
user3|password3
user4|password4
The username and password is sepsrated by '|'
I want to get the 1st row value from the file and assign it to two different variables(username and password)
in my... (1 Reply)
Discussion started by: priya001
1 Replies
9. Shell Programming and Scripting
Hi,
I need a shell script, which would search the result values from another files.
1)execute " select column1 from table_name" query on the table.
2)Based on the result, need to be grep from .wft files.
could please explain about this.Below is the way i am using.
#!/bin/sh... (4 Replies)
Discussion started by: Rami Reddy
4 Replies
10. Shell Programming and Scripting
I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables.
I need to read this file which is an input to my script
Config.txt
file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies
LEARN ABOUT HPUX
xmlistpostobounds
XmListPosToBounds(library call) XmListPosToBounds(library call)
NAME
XmListPosToBounds -- A List function that returns the bounding box of an item at a specified position in a list
SYNOPSIS
#include <Xm/List.h>
Boolean XmListPosToBounds(
Widget widget,
int position,
Position *x,
Position *y,
Dimension *width,
Dimension *height);
DESCRIPTION
XmListPosToBounds returns the coordinates of an item within a list and the dimensions of its bounding box. The function returns the associ-
ated x and y-coordinates of the upper left corner of the bounding box relative to the upper left corner of the List widget, as well as the
width and the height of the box. The caller can pass a NULL value for the x, y, width, or height parameters to indicate that the return
value for that parameter is not requested.
widget Specifies the ID of the List widget.
position Specifies the position of the specified item. A value of 1 indicates the first item in the list; a value of 2 indicates the sec-
ond item; and so on. A value of 0 (zero) specifies the last item in the list.
x Specifies a pointer to the returned x-coordinate of the item.
y Specifies the pointer to the returned y-coordinate of the item.
width Specifies the pointer to the returned width of the item.
height Specifies the pointer to the returned height of the item.
For a complete definition of List and its associated resources, see XmList(3).
RETURN
If the item at the specified position is not visible, returns False, and the returned values (if any) are undefined. Otherwise, this func-
tion returns True.
RELATED
XmList(3) and XmListYToPos(3).
XmListPosToBounds(library call)