[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] DAT files



Hi Maria,
SQR can read Excel spreadsheets that have been saved in TXT
(tab-delimited) or CSV (comma-delimited).  In the end, it doesn't matter
what the file extension is,  just how the file itself is formatted. 
After saving, you could rename the file with a DAT extension if you'd
like.

I prefer tab-delimited files because commas occur too frequently in the
data itself.
I sometimes rename the extension to TAB after saving in Excel, to
remind myself what kind of file it is.


In your SQR, you should open the file

     let $Filename = 'C:\whatever_path\filename.txt' 
     open $FileName as 1 for-reading record=200:Vary

and a loop to read the file  (where $TAB is defined by     ENCODE
'<09>' into $TAB )

   while 1 = 1
      read 1 into $Input_Record:200
      unstring $Input_Record by $TAB into -
          $Field01  $Field02  $Field03               (... and so on)

      if #end-file = 1
         break
      end-if

     do Do-Whatever-Processing-you-need

endwhile



I hope this helps.





Daniel Brinkley
Sr. Programmer/Analyst
Techneglas, Inc.
Columbus, OH


fax: (614) 445-4723

>>> mlindqui@uwc.edu 06/10/2003 4:59:47 PM >>>
What do you mean "open a file for writing". I'm trying to save an
excel
file as a .dat file. There is no choice for .dat.


-----Original Message-----
From: Mark Hall [mailto:Mark.Hall@parkview.com] 
Sent: Tuesday, June 10, 2003 3:48 PM
To: sqr-users@sqrug.org; Lindquist, Maria
Subject: Re: [sqr-users] DAT files


open a file for writing.  Then use the write command.  See your sqr
user's manual.  
 
Mark Hall
IS Analyst
ERP Team
260-373-8796
mark.hall@parkview.com 


>>> mlindqui@uwc.edu 06/10/03 03:37PM >>>
How do you create .dat files? Like for instance I need to use a dat
file
when loading External Files into our database.



Maria K Lindquist
mlindqui@uwc.edu <mailto:mlindqui@uwc.edu> 
IS Programmer/Analyst - Business Office
University of Wisconsin Colleges
780 Regent St, PO Box 8680, Madison, WI  53708-8680
Phone: 608.265.2677 / Fax: 608.265.5770



_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users 


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org 
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users