Formatting ASCII to be read by Windows NotePad

U

UnRiel

I have a nice PERL script I use to generate CISCO configurations, but
when I FTP the files to my Windows XP PC and try to read them in
Notepad, there is clearly no line wrap that Notepad understands. If I
otherwise read the file into WordPad first, save the file, then open
into Notepad, the formatting presents correctly.

I have generated the ASCII files using a simple 'print' command to a
file I generate using an 'open' command. I have tried both the newline
\n and the carriage return \r format characters.

Before I begin experiment with other characters, does anyone have a
solution for me gained from similar experience?

Thanks!
 
W

Waylen Gumbal

Sherman said:
No need to shout - neither Perl nor Cisco are acronyms.

I don't think two all-caps words in a sentence that's otherwise properly
cased really constitutes shouting.


Transfer the files in text mode. That will translate the line endings
as needed.

While it is common to use ASCII mode one should still take care, as this
isn't always guarenteed to work. There used (still are?) issues with
this when uploading to MacOS based servers, for example.
 
U

UnRiel

Use ASCII mode rather than binary when using FTP to transfer text files
from a Unix/Linux environment to a DOS/Windows environment. That way FTP
transforms line-endings to the ones needed by the target platform.

Thanks to all. The ASCII mode FTP worked.
 
W

Waylen Gumbal

Sherman said:
It's shouting those words.

Not in that context it wasn't.



I've had issues in the past uploading to a MacOS based ftp server
(remember that Mac uses \r for line endings, where as Win32 uses \r\n,
and most Linux and Unix systems use \n) and when uploading in "ASCII"
mode, the line endings became \n instead of \r (this happened with 3
different ftp clients, including the command line ftp client, so I
attribute the problem likely was the server wasn't properly telling the
client what sort of platform it was (what line endings it used.)

I'm sure theres other examples of this problem; it can come from
improperly configured ftp servers or clients too.
 
B

Bill H

You must be new to usenet. All caps is considered shouting here,
unless that's the correct spelling of a word or acronym, and as I
said, that applies to neither Perl nor Cisco.



I've been using a Mac for ten years, and I wrote the readme.macosx
that's included with Perl. So spare me the lectures.

Yes, I do remember that MacOS once, many years ago when "classic"
MacOS was relevant, used to use \r. Mac OS X uses \n, just like any
other Unix, as documented here:

<http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSyst...>
<http://tinyurl.com/58w7dy>

This ain't your grandpa's Mac any more. Try to keep up, OK?


You're beginning to try my patience. This is little more than "it
didn't work." What *specific* server app were you connecting to? What
client were you using? What version of both?

Note that according to RFC 959, the client sends \r\n pairs in ASCII
mode, which the server translates to its native format. Because a
"neutral" format is used in transit, neither client nor server is
aware, nor needs to be aware of the native format used by the other,
by design. Your attribution of the problem, as you wrote it above,
makes no sense.

Do you have anything *useful* to say here? Do you actually understand
the FTP protocol? Did you actually debug the problem you had? Or are
you basically just saying "I had a problem in the past, and it must
have been the Mac at the other end because Macs are weird"?

sherm--

--
My blog:http://shermspace.blogspot.com
Cocoa programming in Perl:http://camelbones.sourceforge.net- Hide quoted text -

- Show quoted text -

I'll jump on the Mac ftp issue bandwagon and even make it pertain to
perl. I have a couple of clients using DreamWeaver in OS X that,
whether due to settings or the OS, when they post their webpages or
perl scripts to one of my linux servers they wind up with the "\r" in
the scripts and a blank line after every line in the html files. The
servers themselves don't care and it all works good, but if I then d/l
the files via ftp (ascii mode) to the pc the perl scripts loose all
line feeds (i have to open and save using edit.com to get them back)
and the extra blank lines in html stay are still there. Now one of
these same clients has used fetch (or the OS X equivalent) and this
problem went away, so it may be a Dreamweaver issue.

I also know, on a few of the Mac servers that I have had the "joy" of
moving websites off of, when d/ling the files via ftp, no setting
change (ascii or binary) will ever fix the lack of line feeds in the
files I receive from the Mac.

Bill H
 
W

Waylen Gumbal

Sherman said:
You must be new to usenet. All caps is considered shouting here,
unless that's the correct spelling of a word or acronym, and as I
said, that applies to neither Perl nor Cisco.

I am not new to the usenet. Anyone who made it past the 4th grade can
see shouting wasn't his intention. Please stop pretending you didn't
know it wasn't his intention.


Yes, I do remember that MacOS once, many years ago when "classic"
MacOS was relevant, used to use \r. Mac OS X uses \n, just like any
other Unix, as documented here:

That doesn't matter. It can be a client and/or server software issue.
This ain't your grandpa's Mac any more. Try to keep up, OK?

Non sequitur. It's not so much the OS, but programs (client or server)
that are incorrectly configured. You can never take for granted that a
remote FTP server you are given to connect to will be setup right. Same
goes for the default settings of a given client.

Note that according to RFC 959, the client sends \r\n pairs in ASCII
mode, which the server translates to its native format. Because a
"neutral" format is used in transit, neither client nor server is
aware, nor needs to be aware of the native format used by the other,
by design. Your attribution of the problem, as you wrote it above,
makes no sense.

Are you aware that not all software necessarily (properly) follows an
RFC that it should be following? You can never take for granted that any
piece of software you install will work perfectly. Checking in advance
helps, but there can always be suprises even reviewers can miss.

Do you have anything *useful* to say here?

Are you going through some rough times? Else, why do you find it so
necessary to so unpleasant to others. I don't recall ever doing anything
cross towards you, so I don't know why you can't simply discuss things
in a calmer tone.
 
W

Waylen Gumbal

Sherman said:
I find it necessary to correct nonsense when I see it, for the sake of
those who might otherwise be misled into believing it. If you find
that unpleasant, don't post nonsense.

I didn't post nonsense. Do you act this same way in real life too?

I'm obviously not the only to have run into such issues (regardless of
destination and source platforms), so I don't know where you get off
taking that stance.
 
W

Waylen Gumbal

Sherman said:
So where, exactly, did you post a specific problem with a specific
app, as opposed to vague hand-waving about an entire platform that you
obviously know very little about?

I did post a specific problem; EOL translation between platforms, in the
realm of FTP, based on my own experience.


I'm taking it because I haven't yet seen an accurate description of
the problem you claim to have had.

I was just tell of my own experience regarding EOL.
First you claim that a particular OS may have problems,

I never made any such claim.

then when I asked for details you gave me a bunch of hand-waving
about an FTP server supposedly not informing the client what it was,
when in fact *no* FTP server does so for ASCII transfers, nor needs
to.

Because it was some time ago. I was just recalling an experience. Why do
you care so damn much anyways? Who asked you to be a lawyer?

In this whole sorry thread, I've yet to see a single coherent, logical
description of the problem you supposedly had. Nor have I seen a bit
of evidence that you know anything about the FTP protocol.

I don't have to prove any thing. I know how FTP work and I know there
are many server and client implementations released over the years that
could misbehave when it comes to converting EOLs.

You really should read this, if you intend to discuss technical issues
with adults:

Maybe you should learn to act like an adult, instead of jumping all over
someone's back as if you're drug sniffing canine. There is no reason to
act this way, and in many people's eyes you come off as entirely
condescending. Please be civil of fsck off.
 
W

Waylen Gumbal

Sherman said:
Your own words, directly copied and pasted:

"While it is common to use ASCII mode one should still take care, as
this isn't always guarenteed to work. There used (still are?) issues
with this when uploading to MacOS based servers, for example."

Yes, as I have run into such issues in the past. I'm still not sure why
you are turning a simple comment into a federal investigation.


I care about accuracy in the technical fora in which I participate -
and I don't recall needing to be asked by you to care about it.

Caring about accuracy is one thing, but you're clearing taking a simple
comment and making it into something it's clearly not. You seem to be
bent on making WWIII out of a paint ball battle, for what reason I
really don't know.

Do you? Then why did you - again, your own words - "attribute the
problem likely was the server wasn't properly telling the client what
sort of platform it was"?

Christ, it was a guess. Again, why are you making Mt. Everest out of a
half-foot tall ant hill? This is not simple fact hunting on your part,
it is some obsession of yours where it seems you wont stop until I'm
politely kissing your shoes. News flash: no one likes being talked to,
and it's certainly not a way to make someone see your view.


If you actually knew how FTP works, at the protocol level, you would
know that no server ever tells the client that. It doesn't need to -
both client and server transforms the text to and from its native
format to ASCII with \r\n for transport. Neither one needs to know or
care about the native format of the other.

I never claimed to know how every inch and cm of the FTP protocol, so
why are you making this assertion? Why are you so obsessed with this?

I worked in web hosting for many years, and I've answered this and
similar questions literally hundreds of times. In every single case,
without exception, the answer was that the user was expecting ASCII
mode to handle translations that it isn't designed to handle.

I have been there too, and in many other situations on various
platforms. Just because you haven't seen a particular issue doesn't mean
it doesn't exist. At least one other poster here has pointed out problem
with a particular client that incorrectly converted EOLs, and I've seen
many other EOL conversion issues.


For instance, if one uploads a file with \r in binary mode to a Unix
server, it's not in the server's native text format. So, when someone
else downloads that file later on, in ASCII mode, the server doesn't
translate it - there are no \n's in the file to translate, and an FTP
server will *only* translate its native format.

This is likely where some problems arise. Other arise from improperly
configured software, at either end. Or a mix thereof.

The most common cause of problems, in my experience, is users who
expect ASCII mode to translate all kinds of line endings to the
client's native format, when in fact that's not what is supposed to
happen.

This is true, but it's not the only reason.


I *am* being civil. I'm simply correcting misinformation; if your
feelings are hurt in the process, that's your problem. If you can't
stand being corrected, check your facts before posting.

What misinformation? What correction? I stated a comment based on my own
experience, and you want to tell me I didn't see what I did in fact see?
What makes you so qualified to tell me what my own experiences are?
 
S

Stephan Bour

Sherman Pendley wrote:
}
} > Sherman Pendley wrote:
} > >
} > > > I have a nice PERL script I use to generate CISCO configurations
} > >
} > > No need to shout - neither Perl nor Cisco are acronyms.
} >
} > I don't think two all-caps words in a sentence that's otherwise
} > properly cased really constitutes shouting.
}
} It's shouting those words.

Nonesense. Obviously you know what he meant by "PERL" and "CICSO", there
really isn't anything wrong about writing it that way, unless you want to be
an absolute perfectionist.

} > > Transfer the files in text mode. That will translate the line
} > > endings as needed.
} >
} > While it is common to use ASCII mode one should still take care, as
} > this isn't always guarenteed to work. There used (still are?) issues
} > with this when uploading to MacOS based servers, for example.
}
} Such as?

I've seen some pretty crazy where file that originally had \r\n ended up
being \r\n\n, which interestingly, occurred with a version of Serv-U (which
I recall was fixed in the next release),

And while not FTP, I've seen interesting line-terminator situations from web
forms ,for text coming from a TEXTAREA, though this was probably more the
fault of server-side scripting that handled the form input, making poor
assumptions about the incoming data.

Either way, it's always prudent to check to make sure a file has transferred
the way you think it has. If you're uploading to a UNIX-based server, you
can write a simply script to do a hex-dump of a file. If you see 0D0A when
you expect 0D, then something went wrong, and you should never assume, when
dealing with a foreign server you haven't used before, that it will have
transferred properly and that it needn't be checked.


Stephan.
 
B

Ben Morrow

Quoth Sherman Pendley said:
Seriously! Otherwise this thread is going nowhere, and I'm
done with it.

Thank you. I, at least, wish you'd reached this point somewhat sooner.

Ben
 
W

Waylen Gumbal

Sherman said:
I asked you a simple question - "Such as?" What's so unreasonable
about that question? Why are you dodging it? If you know of a specific
problem with Mac FTP servers, just say so - I use a Mac every day and
I'd love to know about it.

I wasn't dodging anything. I simply was sharing my experience. I even
todl you before that I don't remember what client or server software it
was, maybe I wasn't clear, but it should be now.

Then why didn't you say so?

I thought this was clear from the beginning
Why are you trying to pass off a guess as knowledgable advice?

There you go again, making up your own reality. In the one everyone else
is living in, I simply made a comment and I never tried ot pass it off
as "knowledgable advice" as you claim.


Because you claimed to have accurately diagnosed a problem with an
FTP server. Without a protocol-level understanding of FTP, such a
claim is pretty hard to swallow.

I never made such a claim. Why must you lie to make your points?

What I did say was that I experienced such a problem as I described, in
effort to share my experience, and you're just turning that completely
upside down.

Why are you trying to paint me as a lunatic

I'm sorry, but I haven't needed to do any of the painting. You've done
that quite well yourself with your unwillingness to discuss civilly and
insistence to act like you're a lawyer.

Nice straw man. I'm not denying that there can be "issues"; what I'm
denying is your assertion that they're more common when the server is
running on a Mac.

I NEVER made such an assetion. I merely used it as an example based on
experiences I've had. It is clear to me you would rather respond in your
offensive-superior tone rather than actually discuss things like two
rational individuals.
 
S

Stephan Bour

Ben Morrow wrote:
} Quoth Sherman Pendley <[email protected]>:
} >
} > Seriously! Otherwise this thread is going nowhere, and I'm
} > done with it.
}
} Thank you. I, at least, wish you'd reached this point somewhat sooner.

Do you mean to tell me that you believe Mr. Pendley hold absolutely no
responsibility for the thread taking the direction it did? Do you really
believe his behavior in the thread is an example of how one should attempt
to communicate with someone else?

In my humble opinion, people like Pendley need to be told what they are
doing wrong, rather than simple encouraged to continue attacking people like
this. I honestly can not hold Mr. Gumbal at fault in this thread as it is
quite evident he was forced into a corner. This is just wrong.


Stephan.
 
S

Stephan Bour

Sherman Pendley wrote:
}
} > Quoth Sherman Pendley <[email protected]>:
} > >
} > > Seriously! Otherwise this thread is going nowhere, and I'm
} > > done with it.
} >
} > Thank you. I, at least, wish you'd reached this point somewhat
} > sooner.
}
} I always try to give people a chance to discuss things rationally. A
} demonstration of hope over experience, I guess. But even the most
} optimistic of us has to give up on hopeless trolls eventually.

But this isn't' what *you* did. You backed Mr. Gumbal into a corner, you
started a fight where once surely wasn't needed. You did anything but
discuss things rationally. You turned a discussion into a lawyer-esque
attack. This not an example people should be seeing.


Stephan.
 
S

Stephan Bour

Sherman Pendley wrote:
}
} > Why must you lie to make your points?
}
} That's it. I've tried to be civil with you, and I'm tired of your
} constant attacks and refusal to discuss a technical issue in a
} rational manner. Into the killfile you go.

You have not been arguing in in a rational manner. You have completely
ignored his responses saying he doesn't have all the details, and you
repeatedly made assuptions and assertions he did not make. You are the one
who is in the wrong here. Stop being such a bully for $deity sake.


Stephan.
 
S

Stephan Bour

Sherman said:
"Stephan Bour" <[email protected]> writes:
}
} > } I always try to give people a chance to discuss things rationally.
} > } A demonstration of hope over experience, I guess. But even the most
} > } optimistic of us has to give up on hopeless trolls eventually.
} >
} > But this isn't' what *you* did.
}
} That is in fact exactly what I did. He asserted that Mac-based FTP
} servers had "problems".

No he didn't. He said he encountered a with line termination translation and
used a Mac server as an example. That's not the same as saying the Mac ftp's
are bugged. You are mixing two different things.

} I asked him a simple two-word question: "Such
} as?" I asked this because I use a Mac every day, and if there *are*
} such problems I would sincerely like to know about them.

You didn't ask that at first. You came across as demanding, which is hardly
the way to persuade someone to deal nice with you. He also had already told
you he was just recalling an experience and didn't recall all the details
but you ignored that and persisted.

} I continued to give him every chance to support his assertion with
} evidence.

Why is it you cannot distinguish between a simpel comment and a detailed
assertion about something?

} Instead of doing so, he resorted to crying about civility and
} accusing me of being a liar.

Because you were pushing rather hard. On top of that you kept on telling him
he made assertions he never made. In my book that constitutes a lie. Or at
least, it's dishonest.

} > You turned a discussion into a lawyer-esque attack.
}
} Nonsense. A request for evidence to support a dubious claim is not an
} "attack." If someone can't argue a technical point without taking it
} personally, that's *his* problem, not mine.

What is wrong with you? It was a comment from something he was remembering.
Do you honestly remember every single detail about every single thing you've
done in your life time?

} > This not an example people should be seeing.
}
} What do you suggest as an alternative then? Should we allow nonsense
} to stand unremarked and uncorrected, potentially misleading those who
} don't know better, just to avoid hurting the feelings of the over-
} sensitive and easily offended?

This was clearly not an issue about nonsense, but about people like yourself
who spin into their own personal crusades just because they don't agree with
something or because they have to see and push something as being more than
it really is. a simple comment is not always meant to be taken in the same
way as a detailed write up on a given subject. Sometimes such things should
be taken at face value.

And if someone does in fact answer you and you blatantly ignore it and
continue on pushing, then you are clearly in the wrong, and should
apologize, if you have any honour.

} This is a technical forum. If you want sound, accurate advice about
} Perl, you can find it here.

There's no reason one shouldn't be able to make a simple comment without
being put in front of a firing squad. Please stop making excuses for verbal
brutality.

Stephan.
 
B

Bill H

  In real like, Pendley's behavior would never be tolerated.
  Especially in an academic institution.


  The problem is, people like him wont listen; they believe
  they are higher up in the intelligence chain and therefore
  don't have to adhere to the same rules of conduct as everyone
  else. At least this is the message he seems to be sending.

Reading this thread I feel like I am back at school on the playground
and someone just yelled FIGHT!

Bill H
 
S

Stephan Bour

Sherman Pendley wrote:
}
} > Sherman Pendley wrote:
} >
} > } I asked him a simple two-word question: "Such
} > } as?" I asked this because I use a Mac every day, and if there *are*
} > } such problems I would sincerely like to know about them.
} >
} > You didn't ask that at first.
}
} Check again please:
}
}
<http://groups.google.com/group/comp...32/a0ef8bad667b1f81?lnk=raot#a0ef8bad667b1f81>
}
} "Such as?" is *exactly* what I asked at first.

Ok, I made that mistake, but the point I was getting at is that you kept
pushing after he answered that question. He made it clear he didn't remember
al lthe details, but you kept on asking. You were more demanding then simply
asking.

} He chose to answer it with a condescending attitude, talking down to
} me as if I'm a clueless newb who needs to be lectured about what line
} endings "classic" MacOS used to use.
}
} Further, the example he gave after the lecture showed a complete
} lack of understanding of the FTP protocol, and a conclusion that
} was nonsensical on the face of it.

What the hell are you talking about? You are the one who kept "talking down"
and responding with a "condescending attitude". You are the one who kept
ignoring his responses and continued to ask. All he did was making a comment
and you turned it into some stupid crusade and now you're attempting to dish
out every trick in the book in order to vindicate yourself.

If you have a shred of decency, you'll stop spinning your elaborate web of
lies and just come out and admit you took all of this a bit too far, as that
is exactly what happened here. But if you prefer to live in your own
alternate reality that's your choice.


Stephan.
 
B

Ben Morrow

Quoth Sherman Pendley said:
Funny you should say that - I'm beginning to feel like the only adult
in a playground full of screaming children.

The sensible response, then, is not to keep screaming back.

(I'm saying this to you rather than anyone else in this thread because I
have somewhat more hope you'll see reason.)

Ben
 
S

Stephan Bour

Sherman Pendley wrote:
}
} > and you turned it into some stupid crusade and now you're attempting
} > to dish out every trick in the book in order to vindicate yourself.
}
} Vindicate myself to whom? You? Who appointed you to the Usenet Police?
} Get over yourself already.

I am not more a "Usenet Police" officer than you are, yet you seem to have
no problem acting that way yourself; you clearly acted in a tone as if you
were scolding Gumbal for being defiant, for not answering in a way that was
satisfactory to *you*, as if anyone to participates in the same thread is
some how obligated to answer to you. I'm afraid I'm not the one who is
having trouble getting over thy self.


Stephan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top