home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 448a.lha / Citation_Base_v1.1 / REXX / FULL_JOURNAL.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1990-09-13  |  1.4 KB  |  50 lines

  1. /* FULL_JOURNAL.rexx  version 1.1 */
  2. /* This macro can be run from the CLI, SHELL or WorkBench and */
  3. /* acts on a text or word processor based citation database from */
  4. /* which you wish to export full journal names.  The macro writes a */
  5. /* text file with the journal names of each citation/record on a */
  6. /* separate line. */
  7.  
  8. /* open the citation text file (database) for import */
  9. /* NOTE: change the disk/drive designations below to suit your setup */
  10. in_text = getfile(,,'ram:',,'Select citation import file');
  11. if (in_text = '') then exit;
  12. if (open(importfile,in_text,'R') ~= 1) then;
  13.   do;
  14.     say 'I could not open the file ' || in_text || ' for importing.';
  15.     exit;
  16.   end;
  17.  
  18. /* open the text file for export */
  19. out_text = getfile(,,'ram:',,'Select export file name');
  20. if (out_text = '') then exit;
  21. if (open(exportfile,out_text,'W') ~= 1) then;
  22.   do;
  23.     say 'I could not open the file ' || out_text || ' for exporting.';
  24.     exit;
  25.   end;
  26.  
  27.  
  28. /* get the first record */
  29. do loop = 1 to 5;
  30.   rec.loop.value = readln(importfile);
  31. end;
  32.  
  33.  
  34. /* export the journal name for each record/citation in the database */
  35. do while (~EOF(importfile));
  36.   Full_Journal = rec.5.value;
  37.   say Full_Journal;
  38.   foo = writeln(exportfile,Full_Journal);
  39.  
  40.  
  41. /* get the next record */
  42.   do loop = 1 to 5;
  43.     rec.loop.value = readln(importfile);
  44.   end;
  45. end;
  46.  
  47. /* exit macro */
  48. say 'Exported citation journal list in file ' || out_text;
  49. exit;
  50.