Jump to content


Photo
- - - - -

Viewing PROIV produced ASCII files via SAMBA


6 replies to this topic

#1 Peter Russo

Peter Russo

    Member

  • Members
  • PipPip
  • 12 posts
  • Location:Melbourne, Australia

Posted 18 April 2000 - 03:05 AM

Hopefully someone else has come across this issue and solved it.

We are producing a number of ASCII files out of our proiv application, if we view the files under unix they look fine with one line per record.

However when we look at these files from a PC using SAMBA they appear as one line with no separation between records.

The problem is that under unix each record has a linefeed rather than LF and carriage return at the end of the record.

If we pass the file thru unix2dos then it appears fine via the PC.

Is there a way to avoid the unix2dos step and have proiv insert the CR ? without major changes to the application.

Thanks.

Peter.

#2 Dan Shannon

Dan Shannon

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 374 posts
  • Gender:Male
  • Location:Australia

Posted 18 April 2000 - 06:44 PM

Do it using a BINary file definition instead, so that you can manually add the CR as the last character in each record. I know that I did this for the NM Trustees application in 98 some time for one of the extracts (can't remember which one) - ask Messrs Tuke and Zmyslony or look for the BIN type file(s).

It does produce fixed-length records, but it will at least be viewable on the PC.

Otherwise, ftp the file in ASCII mode to a PC or copy it using NFS onto the PC.

Dan Shannon

#3 Guest_Doctor PRO IV_*

Guest_Doctor PRO IV_*
  • Guests

Posted 10 May 2000 - 05:16 PM

The PRO IV solution is quite neat.

The EDIT program (DOS based) program supplied with Windows
is impervious to Unix line endings.

If you save the file after viewing it it will even fix the
file for you.
It is interesting to note that SAMBA provides no help
Excerpt from SAMBA FAQ follows
---------------------------------
CRLF-LF Conversions

We get many requests for CRLF/LF format conversion handling by samba.
The problem is that there is no clean way to determine which files
should / could be converted and which MUST not be.

Since Unix and DOS/Windows uses alike will use .txt to represent a
file containing ASCII text we can not reliably use the file extension.
The same applies to the .doc extension.

Samba operates around the premise that we should leave all files unchanged.
By not implmenting CRLF/LF conversions we can not be guilty of damaging
anyone's files.

When someone comes along with a sound implementation that guarrantees file
integrity we will jump at the opportunity to implement this feature. Until
such time there is no prospect for action on this topic.
--------------------------------------------------------------------------------

#4 Kevin Bruss

Kevin Bruss

    Expert

  • Members
  • PipPipPipPip
  • 113 posts
  • Gender:Male
  • Location:Oklahoma City, OK

Posted 14 February 2006 - 07:40 PM

Or use WordPad instead of Notepad to view the text files; it seems to handle 'nix files better.

#5 TomWhite

TomWhite

    Member

  • Members
  • PipPip
  • 35 posts

Posted 15 February 2006 - 12:36 PM

We found that a utility called TODOS corrected the problem. It gets run against each file and the output is perfect.

#6 Bob Filipiak

Bob Filipiak

    Expert

  • Members
  • PipPipPipPip
  • 133 posts
  • Gender:Male

Posted 15 February 2006 - 02:11 PM

I have had the same problem moving reports from the Convergent (CTIX) to a PC, my solution was to use:

tr -d '15' infile outfile

It appears that the previewer strips away certain characters, so take note, after the '-d' option I have single quote, backslash, 0, 1, 5, single quote; a 'less-than' symbol prefixes infile; and a 'greater-than' symbol prefixes outfile

tr "translates' characters, the '-d' option deletes the specified character; '015' being the OCTAL representation of a carriage return.

a bit messy, but works.


I used a aimilar technique to rip out LF/CR pairs from a report that was designed to output some 80 fields, one field per LINE, with a FF to separate records. Two passes trough tr reformatted the output into one long record per line.

Bob Filipiak

#7 Kevin Bruss

Kevin Bruss

    Expert

  • Members
  • PipPipPipPip
  • 113 posts
  • Gender:Male
  • Location:Oklahoma City, OK

Posted 16 February 2006 - 07:53 PM

I recall 'ux2dos' and 'dos2ux' for 'nix systems. (hp ux if I recall correctly)
Could convert back/forth.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users