Jump to content


- - - - -

Extra blank line in download text file (.txt)


18 replies to this topic

#1 Guest_space_*

Guest_space_*
  • Guests

Posted 30 September 2005 - 03:50 AM

[SIZE=7]
[FONT=Arial]
How to eliminate the extra blank line at the end of the download text file (.txt)?

#2 siobi

siobi

    Member

  • Members
  • PipPip
  • 48 posts
  • Gender:Male

Posted 30 September 2005 - 03:54 AM

you mean....

download from a file to a text file...
and your file had total 3 record, but when you open the text file, it had total of 4 lines,
the last line is blank!!!

I also encounter this before, how to solve?

#3 Neil Hunter

Neil Hunter

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 414 posts
  • Gender:Male
  • Location:Johannesburg, South Africa

Posted 30 September 2005 - 07:42 AM

In what context ?

Are you importing from a txt file ? Exporting to a text file ? Editing an ini file ?

#4 siobi

siobi

    Member

  • Members
  • PipPip
  • 48 posts
  • Gender:Male

Posted 30 September 2005 - 07:55 AM

my scenario is ...

from proiv file download into a txt file...

if provi got 3 records...
then the downloaded txt happend to had 4 lines!!!
the last line having blank data.

#5 Neil Hunter

Neil Hunter

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 414 posts
  • Gender:Male
  • Location:Johannesburg, South Africa

Posted 30 September 2005 - 08:03 AM

How are you exporting to a text file ? Via an update to a SEQ file or using a report to a filename ?

Are you using LF or CR anywhere in your export ?

#6 Guest_space_*

Guest_space_*
  • Guests

Posted 30 September 2005 - 08:27 AM

i am using the ALIAS('seq file name', physical file name) in the Logic In of my update function.

In \US\, i write the data in the seq file using Add mode and mark the Clear File = 'Y'.

I am NOT using LF or CR in my function.
Anyway what is LF and CR?

#7 Neil Hunter

Neil Hunter

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 414 posts
  • Gender:Male
  • Location:Johannesburg, South Africa

Posted 30 September 2005 - 08:52 AM

LF = Line Feed ($FLD = CHAR(10))
CR = Carriage Return ($FLD = CHAR(13)) B)

Are you getting a line between data thats blank ? Or does your data end and then have a blank line ?

Whats \US\ ?

#8 Guest_space_*

Guest_space_*
  • Guests

Posted 30 September 2005 - 09:03 AM

\US\ => Update start.

My data end with a blank line.

For example:
Data 1....
Data 2....
Data 3....
Blank line

#9 Guest_space_*

Guest_space_*
  • Guests

Posted 30 September 2005 - 09:09 AM

The program is very straight forward.

At the Logic In of my update function, i used
ALIAS('seq filename', physical filename)

Then at the update start, i just read some files to get the data i want and write into the seq file.
The seq file is Add Mode and the logic to write the data into this file is placed in the Before Write.
Then i got mark Clear File.

So, anyone can help in this matter as soon as possible?
Need to take out the blank line to allow my functions to work properly when send to user.

#10 Neil Hunter

Neil Hunter

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 414 posts
  • Gender:Male
  • Location:Johannesburg, South Africa

Posted 30 September 2005 - 09:40 AM

Most programs are straight forward B)

You aren't using Superlayer by any weird chance ? Update start is something that I've never heard of.

So pretty much what you saying :

at Function Entry/LS Entry Logic you have ALIAS('SEQFILE','FILEPATH')

you then have

LS1
File 1
File 2
SEQFILE Y for clear with logic on BW to setup your fields ?

Is your seqfile defined as having a single field ie DATA etc or have you defined them as separate fields.

To me it sounds like you have a data problem ie the record doesn't exist on one of the files and your SEQFILE isn't getting set up correctly. Can you try your extract for a different dataset and see if you get the same results ?

#11 Richard Bassett

Richard Bassett

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 696 posts
  • Location:Rural France

Posted 30 September 2005 - 09:47 AM

What platform are you generating the file on?
What platform are you viewing the file on?
What are you using to view the file when you see the blank line?
Nothing's as simple as you think

#12 space

space

    Newbie

  • Members
  • Pip
  • 6 posts
  • Gender:Female
  • Location:Malaysia

Posted 30 September 2005 - 10:05 AM

The seq file has one field only.

I have try in different dataset and the result is same.
My pc is Windows 98 and Windows 2000. But my server is Windows NT.
I view the file using notepad both in Windows 98 and Windows 2000.

#13 siobi

siobi

    Member

  • Members
  • PipPip
  • 48 posts
  • Gender:Male

Posted 30 September 2005 - 10:06 AM

For my case,
I'm using superlayer...

it is an update function

Logic in of the function,
I had Alias(File2,'abc.txt')

at default logic,
I had my SQL query to select from a file,
the file design as below:

File1 (Lookup mode)
File2 (Write Mode)

so when i open the abc.txt,
there is always a blank line appear at the last line!!!

**the data is no problem ...
3 records in file1
but when i open abc.txt, there is always 4 lines, with the last line is a blank line!!!

I think my problem is quite similar to the poster "space"

#14 hendo

hendo

    Member

  • Members
  • PipPip
  • 17 posts

Posted 30 September 2005 - 11:16 AM

I have the same problem when creating a txt file and importing the txt file as a mail merge in word the last record read always sends an error message.
record xxx no data
looking at my txt file with notepad there is a little square at the end of the last record which I think is an end of file marker and word seems to treat this as the last record.
Space, when you look the the txt file with notepad do you have a square at end of your file?

#15 Wim Soutendijk

Wim Soutendijk

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 211 posts
  • Gender:Male
  • Location:Netherlands

Posted 30 September 2005 - 11:57 AM

I havn't tried it myself, but if you change the file type of the text file in pro-iv from SEQ to BIN, pro-iv won't send a CR/LF anymore.
you would have to add the CHAR(13) and CHAR(10) codes yourself to the end of each line when you write them to the file, but very likely, pro-iv won't add something at the end of the file.
I can't remember if you have to send a CR/LF or a LF/CR. Just try and see what happens.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users