<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>HELP<br><br><div>> From: filepro-list-request@lists.celestial.com<br>> Subject: Filepro-list Digest, Vol 135, Issue 14<br>> To: filepro-list@lists.celestial.com<br>> Date: Mon, 13 Apr 2015 02:17:16 -0700<br>> <br>> Send Filepro-list mailing list submissions to<br>>         filepro-list@lists.celestial.com<br>> <br>> To subscribe or unsubscribe via the World Wide Web, visit<br>>   http://mailman.celestial.com/mailman/listinfo/filepro-list<br>> or, via email, send a message with subject or body 'help' to<br>>     filepro-list-request@lists.celestial.com<br>> <br>> You can reach the person managing the list at<br>>       filepro-list-owner@lists.celestial.com<br>> <br>> When replying, please edit your Subject line so it is more specific<br>> than "Re: Contents of Filepro-list digest..."<br>> <br>> <br>> Today's Topics:<br>> <br>>    1. RE: Dropped Fields in Export (Mike Schwartz)<br>>    2. RE: Dropped Fields in Export (Stanley - stanlyn.com)<br>>    3. RE: Dropped Fields in Export (Mike Schwartz)<br>>    4. Re: Dropped Fields in Export (Bruce Easton)<br>> <br>> <br>> ----------------------------------------------------------------------<br>> <br>> Message: 1<br>> Date: Sun, 12 Apr 2015 16:21:42 -0500<br>> From: "Mike Schwartz" <mschw@athenet.net><br>> To: "'Stanley - stanlyn.com'" <stanley@stanlyn.com>,<br>>     <filepro-list@lists.celestial.com><br>> Subject: RE: Dropped Fields in Export<br>> Message-ID: <036f01d07566$ac398870$04ac9950$@athenet.net><br>> Content-Type: text/plain;      charset="us-ascii"<br>> <br>> > Using ScO Unix and filepro 5.0.14.<br>> > <br>> > FilePro's export is dropping fields when the field(s) is empty for all<br>> records.  Is<br>> > this normal?  What would cause this behavior?  What should I do?<br>> > <br>> > Thanks, Stanley<br>> > <br>> > The code below creates a file with 64 delimited fields instead of 73.  It<br>> starts<br>> [snip]<br>> <br>>      Yes, as I recall you are correct.  If the last fields of a record are<br>> blank, the rest of the .CSV record is truncated.   Usually this doesn't<br>> cause any problems, but I recall having to write an export to dump a CSV<br>> file to Peachtree Accounting a few years ago after I discovered the<br>> Peachtree import  wasn't working because the last few "empty" fields weren't<br>> on the filePro exported record.  <br>> <br>>      I solved it in that case by adding an "X" or some such thing in the<br>> last field to be imported.  This caused all the rest of the missing fields<br>> to show up.  As I recall, the last field was a comment field or some such<br>> thing so that was a quick fix.<br>> <br>>      When writing some exports for an insurance company where the last<br>> fields were missing, I think I used the"'-X" option on the filePro export<br>> command, but then I had to insert the quotes and commas to make the record<br>> look like a comma delimited file.  <br>> <br>>      If neither of these options helps you, tomorrow morning (Monday) I will<br>> look back on the code I wrote and let you know how I fixed it.  <br>> <br>> Mike Schwartz<br>>   <br>> <br>> <br>> <br>> ------------------------------<br>> <br>> Message: 2<br>> Date: Sun, 12 Apr 2015 21:04:47 -0400<br>> From: "Stanley - stanlyn.com" <stanley@stanlyn.com><br>> To: <mschw@athenet.net><br>> Cc: filepro-list@lists.celestial.com<br>> Subject: RE: Dropped Fields in Export<br>> Message-ID:<br>>     <!&!AAAAAAAAAAAYAAAAAAAAAPR6Tw5LnS5CoVg+IvMfAXDCgAAAEAAAAOCYqWVmkLJNnpd1ASahQmMBAAAAAA==@stanlyn.com><br>>   <br>> Content-Type: text/plain;        charset="us-ascii"<br>> <br>> Hi Mike,<br>> <br>> Currently I do the export in record number order.  So wonder if I add a<br>> string to record #1's empty fields like "EMPTY" and remove it later by<br>> replacing "EMPTY" with "".<br>> <br>> Do you know if the output export file's structure is defined on what the<br>> actually data looks like from the first record it processes, and holds true<br>> for all subsequent records?  My documents doesn't talk about any of this...<br>> <br>> Thanks, Stanley<br>> <br>> <br>> <br>> <br>> <br>> -----Original Message-----<br>> From: Mike Schwartz [mailto:mschw@athenet.net] <br>> Sent: Sunday, April 12, 2015 5:22 PM<br>> To: 'Stanley - stanlyn.com'; filepro-list@lists.celestial.com<br>> Subject: RE: Dropped Fields in Export<br>> <br>> > Using ScO Unix and filepro 5.0.14.<br>> > <br>> > FilePro's export is dropping fields when the field(s) is empty for all<br>> records.  Is<br>> > this normal?  What would cause this behavior?  What should I do?<br>> > <br>> > Thanks, Stanley<br>> > <br>> > The code below creates a file with 64 delimited fields instead of 73.  <br>> > It<br>> starts<br>> [snip]<br>> <br>>      Yes, as I recall you are correct.  If the last fields of a record are<br>> blank, the rest of the .CSV record is truncated.   Usually this doesn't<br>> cause any problems, but I recall having to write an export to dump a CSV<br>> file to Peachtree Accounting a few years ago after I discovered the<br>> Peachtree import  wasn't working because the last few "empty" fields weren't<br>> on the filePro exported record.  <br>> <br>>      I solved it in that case by adding an "X" or some such thing in the<br>> last field to be imported.  This caused all the rest of the missing fields<br>> to show up.  As I recall, the last field was a comment field or some such<br>> thing so that was a quick fix.<br>> <br>>      When writing some exports for an insurance company where the last<br>> fields were missing, I think I used the"'-X" option on the filePro export<br>> command, but then I had to insert the quotes and commas to make the record<br>> look like a comma delimited file.  <br>> <br>>      If neither of these options helps you, tomorrow morning (Monday) I will<br>> look back on the code I wrote and let you know how I fixed it.  <br>> <br>> Mike Schwartz<br>>   <br>> <br>> <br>> <br>> <br>> ------------------------------<br>> <br>> Message: 3<br>> Date: Sun, 12 Apr 2015 21:51:56 -0500<br>> From: "Mike Schwartz" <mschw@athenet.net><br>> To: "'Stanley - stanlyn.com'" <stanley@stanlyn.com><br>> Cc: filepro-list@lists.celestial.com<br>> Subject: RE: Dropped Fields in Export<br>> Message-ID: <03a501d07594$ce0d92b0$6a28b810$@athenet.net><br>> Content-Type: text/plain;     charset="us-ascii"<br>> <br>> > Currently I do the export in record number order.  So wonder if I add a<br>> string<br>> > to record #1's empty fields like "EMPTY" and remove it later by replacing<br>> > "EMPTY" with "".<br>> > <br>> > Do you know if the output export file's structure is defined on what the<br>> > actually data looks like from the first record it processes, and holds<br>> true for all<br>> > subsequent records?  My documents doesn't talk about any of this...<br>> > <br>> > Thanks, Stanley<br>> <br>>      As I recall, each record gets truncated if the last fields in that<br>> record are empty.  So doing putting "EMPTY" only at the end of record #1<br>> won't help.<br>> <br>>      AFAIK, this is a problem only with filePro's EXPORT command.  If you<br>> create the file any other way, I don't think you will have this problem.<br>> For example, see functions like:  Writeline(), CREATE(), OPEN(), READ(),<br>> READLINE(), WRITE().<br>> <br>>      Stuart Werner's filepro training books (Developer reference series)<br>> have good sections describing how to create output files using several<br>> different methods.<br>> <br>> Mike<br>> <br>> <br>> <br>> <br>> ------------------------------<br>> <br>> Message: 4<br>> Date: Mon, 13 Apr 2015 00:06:48 -0400<br>> From: Bruce Easton <bruce@stn.com><br>> To: Filepro-list@lists.celestial.com<br>> Subject: Re: Dropped Fields in Export<br>> Message-ID: <552B40D8.3060103@stn.com><br>> Content-Type: text/plain; charset=windows-1252; format=flowed<br>> <br>> I believe one way to handle this situation is to, for the first record <br>> processed only, have it export first a heading row where every column is <br>> populated (for example below I use a "~" char).  To produce the heading <br>> row, you could use  something like:<br>> <br>> xagain If:<br>> Then: export ascii data = . . . . . .<br>> ------- - - - - - - - - - - -<br>> If: dh eq ""     '(start special heading prc)<br>> Then: data(1)="~"; data(2)="~"; data(3)="~"... etc<br>> ------- - - - - - - - - - - -<br>> If: dh eq ""<br>> Then: data(4) = "~"; ........ data([highest col#])="~"<br>> ------- - - - - - - - - - - -<br>> If: dh eq ""<br>> Then: dh(1,*,g)="Y"; goto xagain 'to signal end of heading prc<br>> ------- - - - - - - - - - - -<br>>         '**NOTE: dh is global**<br>> ------- - - - - - - - - - - -<br>> If:                 '(start normal exporting for all recs)<br>> Then: data(1)=f&gg&....<br>> .<br>> .<br>> .<br>> <br>> All the lines above starting with "If: dh eq """ would only export just <br>> ahead of the normal export of that first record being processsed.<br>> <br>> Of course, once run, you then need to remove the first row from the <br>> exported file.<br>> Since you're on unix, you could use something like this outside of <br>> filepro processing to automate removal of first row:<br>> <br>> sed '1d' file.txt > tmpfile; mv tmpfile file.txt<br>> <br>> Bruce<br>> <br>> <br>> <br>> On 4/12/15 10:51 PM, Mike Schwartz wrote:<br>> >> Currently I do the export in record number order.  So wonder if I add a<br>> > string<br>> >> to record #1's empty fields like "EMPTY" and remove it later by replacing<br>> >> "EMPTY" with "".<br>> >><br>> >> Do you know if the output export file's structure is defined on what the<br>> >> actually data looks like from the first record it processes, and holds<br>> > true for all<br>> >> subsequent records?  My documents doesn't talk about any of this...<br>> >><br>> >> Thanks, Stanley<br>> >       As I recall, each record gets truncated if the last fields in that<br>> > record are empty.  So doing putting "EMPTY" only at the end of record #1<br>> > won't help.<br>> ><br>> >       AFAIK, this is a problem only with filePro's EXPORT command.  If you<br>> > create the file any other way, I don't think you will have this problem.<br>> > For example, see functions like:  Writeline(), CREATE(), OPEN(), READ(),<br>> > READLINE(), WRITE().<br>> ><br>> >       Stuart Werner's filepro training books (Developer reference series)<br>> > have good sections describing how to create output files using several<br>> > different methods.<br>> ><br>> > Mike<br>> ><br>> ><br>> > _______________________________________________<br>> > Filepro-list mailing list<br>> > Filepro-list@lists.celestial.com<br>> > Subscribe/Unsubscribe/Subscription Changes<br>> > http://mailman.celestial.com/mailman/listinfo/filepro-list<br>> ><br>> <br>> <br>> <br>> <br>> ------------------------------<br>> <br>> Subject: Digest Footer<br>> <br>> _______________________________________________<br>> Filepro-list mailing list<br>> Filepro-list@lists.celestial.com<br>> http://mailman.celestial.com/mailman/listinfo/filepro-list<br>> <br>> <br>> ------------------------------<br>> <br>> End of Filepro-list Digest, Vol 135, Issue 14<br>> *********************************************<br></div>                                    </div></body>
</html>