loop question



Hello fellow fellows,

I have a file named "INPUT" that contains thousands of lines. Example:
101001 2345
101002 4359
101003 25459
.... etc...

What Id like to do, is be able to set each line as a variable
in a loop.
Example:
$1 = 101001
$2 = 2345

$1 = 101002
$2 = 4359

$1 = 101003
$2 = 25459

If I can get the variables set as above, I can pass them to
an isql statement for a mass update of a database table.

# while read INPUT
# do
for i in `cat INPUT`
do
echo "i: ${i}"
echo "------- \c" ; read ans
done
# done

Obviously, the loop above echo's each column seperately, and
not as one line... and trying to get the output as a $1/$2
is not working.

Any ideas where I'm going wrong?
TIA,
Jeff H

.



Relevant Pages

  • Re: Error when entering wrong data type in do-while loop
    ... Jeff wrote: ... > I have homework for a larger program than shown below but the code below ... > The concept is 'that the loop should work under all conditions'. ... > At the moment if a character is entered, the result is that the screen ...
    (comp.lang.cpp)
  • Re: 2 column display - HELP SQL/ASP
    ... Thanks Jeff - this certainly helped me understand what the code is I have. ... The question I have now is - I understand the loop part on the TD's, ... if objRs.EOF then exit do ... >>Dim allStores, numOfStore ...
    (microsoft.public.inetserver.asp.db)
  • Re: Random not being so random
    ... Jeff, ... Basically your loop is fast enough that the seed that Random is deriving ... |I was testing out some code to create a string of random characters. ... | Dim rGen as New Random ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Waiting for MSDE
    ... after the service reports 'Running'. ... > Hi Jeff, ... > failedwhen intializing the SqlConnection, ... you can sleep for serveral seconds in the while loop if you feel it ...
    (microsoft.public.sqlserver.setup)
  • Re: looping question
    ... first set of records, and not the second. ... >> want to get rid of, is having the extra column on the right that says ...
    (microsoft.public.inetserver.asp.general)