Normal Topic blank lines in ascii-file! (Read 725 times)
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
blank lines in ascii-file!
Dec 28th, 2011 at 3:35pm
Print Post Print Post  
I have a form with 10 Items (no subform) and would like through a report to export as ascii-file. That export process is fine but i get a blank line after each record. Since the exported file includes blank lines, i can not import it in another form. Please how can I avoid the blank lines.
Hier is the Report code :

GlobalCODE

stat sFH as Int
stat sPath as String


sPath     =  "F:\Sesame2\Data\EXPORT\"

OutputFile LE:

Var vFile as String
var n as Int

For n=1 to 10

IF @("K"+@Str(n)) <> ""

vFile +=
@chr(34) + @Str(Eingang) + @chr(34) +
"," + @chr(34) +  @Str(PNr)            + @chr(34) +
"," + @chr(34) +  @Str(LfDNr)          + @chr(34) +
"," + @chr(34) +  @Str(Labor)          + @chr(34) +
"," + @chr(34) +  @("K"+@Str(n))        + @chr(34) +
"," + @chr(34) + @("P"+@Str(n))         + @chr(34) + 
"," + @chr(34) + @("Z"+@Str(n))         + @chr(34) +   
"," + @chr(34) +  @("A"+@Str(n))        + @chr(34) +
"," + @chr(34) +  @("B"+@Str(n))        + @chr(34) +  @Chr(10)

NEXT

FileWriteLn(sFH,vFile)
FileDelete(sPath + "KV_ENTERITIS.TXT")
sFH = FileOpen(sPath +"KV_ENTERITIS.TXT")

LE0:
FileClose(sFH)

Thank you for your help.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Rick_R
Full Member
***
Offline



Posts: 243
Joined: Jan 29th, 2010
Re: blank lines in ascii-file!
Reply #1 - Dec 28th, 2011 at 8:05pm
Print Post Print Post  
FileWriteLn() automaticallys adds a newline for each line written.  Your @Chr(10) is adding the extra line.  See programming manual pages 239-240.
« Last Edit: Dec 29th, 2011 at 3:44am by Rick_R »  
Back to top
 
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: blank lines in ascii-file!
Reply #2 - Dec 29th, 2011 at 10:34am
Print Post Print Post  
Hallo Rick!

Without the @chr(10) The Items are not separated at all.
thank you.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: blank lines in ascii-file!
Reply #3 - Dec 29th, 2011 at 2:24pm
Print Post Print Post  
Hello Amor,

Try switching this line

Code
Select All
FileWriteLn(sFH,vFile) 



to this

Code
Select All
FileWrite(sFH,vFile) 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: blank lines in ascii-file!
Reply #4 - Dec 30th, 2011 at 10:17am
Print Post Print Post  
Hello Ray-
FileWrite has my bug fixed and thank you for the fast help.
i wish you and all the Members of this forum a successful and happy new year.

Dr. Belhareth
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged