Dynamic output file generation using a input text file with predefined output format

Hi,

I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format.

Example:

File.txt

AP|{SSHA}VEEg42CNCghUnGhCVg==
APVG3|{SSHA}XK|"password"
AP3|{SSHA}XK|"This is test"
....
etc

---------

test.sh has following details (already created and working fine with local variables). But, overall I need this working with File.txt as input file to generate single predefined formatted file with different rows mentioned in File.txt file. Thanks a lot.

--------

#!/bin/csh -f
  set VAR1 = 1
  set LOG_FILE="/home/blabla.OUT"
  set VAR2 = 1
  set VAR3 = 1
  clear

# Check if connected and data files were copied
  set TMP_NUM = 0
  while ( $TMP_NUM <= 50 )
#  set LOG_FILE="/home/test/agent$VAR1.ldif"
      echo "dn: ou=agent$VAR1" >> $LOG_FILE
      echo "sunserviceID: 2.2_Agent" >> $LOG_FILE
      echo "ou: agent$VAR1" >> $LOG_FILE
      echo "SunKeyValue: userpassword=password$VAR2" >> $LOG_FILE
      echo "SunKeyValue: description=agent$VAR3" >> $LOG_FILE
      echo "sunsmspriority: 0" >>  $LOG_FILE
      echo "objectClass: sunServiceComponent" >>  $LOG_FILE
      echo "objectClass: top" >>  $LOG_FILE
      echo "sunKeyValue: sunIdentityServerDeviceStatus=Active" >>  $LOG_FILE
      echo "sunKeyValue: sunIdentityServerDeviceKeyValue=" >>  $LOG_FILE
      echo "  " >> $LOG_FILE
@ VAR1 ++
@ VAR2 ++
@ VAR3 ++
      @ TMP_NUM = $TMP_NUM + 1
  end

--------

I wanted to send File.txt into this test.sh to generate a single output file. So, for each row of File.txt, I wanted to repeat the same thing and continue until end of lines in File.txt to have one single output. Thanks a lot

Please show us the required output for the first line on input from file.txt.

Jean-Pierre.