home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / dragen1.zip / hcnvert.cmd < prev    next >
OS/2 REXX Batch file  |  2000-02-19  |  965b  |  36 lines

  1. /*hostconvert*/
  2. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  3. Call SysLoadFuncs
  4.  
  5. filename=hosts.txt
  6. i=0
  7. do while lines(filename)
  8.         i=i+1
  9.         hostval.i.als=linein(filename)
  10.         hostval.i.hst=linein(filename)
  11.         hostval.i.usr=linein(filename)
  12.         hostval.i.pas=linein(filename)
  13.         hostval.i.dir=linein(filename)
  14.         hostval.i.prt=linein(filename)
  15. end /* end do */
  16. hostcount=i
  17. say "the total hosts are "hostcount
  18.  
  19. rc=stream(filename,'c','close')
  20. rc=sysfiledelete(filename)
  21.  
  22. do i = 1 to hostcount
  23.         rc=lineout(filename,hostval.i.als)
  24.         rc=lineout(filename,hostval.i.hst)
  25.         rc=lineout(filename,hostval.i.usr)
  26.         rc=lineout(filename,hostval.i.pas)
  27.         rc=lineout(filename,hostval.i.dir)
  28.         rc=lineout(filename,"")
  29.         rc=lineout(filename,hostval.i.prt)
  30.         rc=lineout(filename,"")
  31. end
  32. rc=lineout(filename)
  33.  
  34. say "conversion done for "hostcount" hosts"
  35.  
  36.