Import issue.

Fairlight fairlite at fairlite.com
Mon Jul 1 08:11:24 PDT 2019


I'll check that out and see if it's replicable.  Thanks, Josh!

mark->

On Mon, Jul 01, 2019 at 02:01:50PM +0000, Josh Reader via Filepro-list thus spoke:
> Hi Mark,
> 
> I just tested and it works to have the 'not lin' line after checking for the existence of data (instead of before).  In the sample below I just used a msgbox command but an export command or writing to a free record in a table could also be performed.  I created the import file in Excel and saved it as .csv.  Then I opened it in Notepad++ and removed the CR LF before processing it using filePro.
> 
> loop	IF:  ' Connect to the import file
> 	THEN: import ascii imp=(im) r=\n f=,
> 	IF:  lin(1) ne ""
> 	THEN:  msgbox lin(1)
> 	IF:  not lin
> 	THEN:  close imp; end
> 	IF:
> 	THEN: goto loop
> 
> Josh
> 
> -----Original Message-----
> From: Filepro-list <filepro-list-bounces+josh.reader=mercuryelectronics.com at lists.celestial.com> On Behalf Of Fairlight via Filepro-list
> Sent: Monday, July 1, 2019 9:34 AM
> To: filepro-list at lists.celestial.com
> Subject: Import issue.
> 
> There's an import with r=\n as the record separation definition.
> 
> There's a line of code testing for 'not lin' if you assume 'lin' is the import alias.
> 
> PROBLEM:  If there is a single record in the file, but the file was written with no newline at all, filePro is reading the actual data (I can see this with strace), but it basically says TRUE to 'not lin'.  If I manually add a newline to the file, lo and behold, it works correctly.
> 
> Is there an elegant way to use \n as the record separator, but still let import work on a single non-terminated record in a file, without pre-processing the file to add a newline if one isn't there?
> 
> mark->
> --
> Fairlight Consulting
> http://www.fairlite.com
> fairlite at fairlite.com
> (502) 509-3840
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes http://mailman.celestial.com/mailman/listinfo/filepro-list
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
> 

-- 
Audio panton, cogito singularis.


More information about the Filepro-list mailing list