|
This is going to be an off the wall question for Scott, but how in the world do you know all of this?
I use FreeBSD (a Unix-like operating system, very similar to Linux) for my desktop. Frequently, I'll be given text files that are formatted for Windows. The difference between a Unix text file and a Windows text file is that in Unix, each line ends with a line-feed character, whereas in Windows each line ends with a carriage return followed by a line feed.
So to convert Windows files to Unix, you have to delete all of the carriage return characters from the Windows file.
To do that in FreeBSD, the easiest way is to use the TR utility. When used with the -d switch, it deletes a character from the file. So I type:
tr -d '\r' < inputfile > outputfileWhen someone asked how to remove quotes from a file, I figured it could work the same way. I opened up the information center and looked to see if QShell had a TR command, and it did. I looked on an EBCDIC chart to see what the EBCDIC code for a quote mark is. Then I tried a quick test and it worked, so I posted it here.
That's how I knew the answer to this question.How do I know "all of this"? That's much harder to answer. I seem to know each thing for a different reason. Some of it because I use it at work. Some of it because I read about it once. Some of it because it's been asked on these forums before, and I learned from the responses. The list of sources goes on and on...
It also may look like I know more stuff than I do, because you don't see me scratching my head when I read a message that I didn't understand, or that I had no clue what the answer was about. The only time you see my reaction is when I happen to know the answer. The rest of the time, I don't say anything.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.