Help - Search - Members - Calendar
Full Version: How to take this command one step further
Productivity Talk > Software > Mike DeTuri's Linux Forum
Harrie
I have a file on my Desktop, UpperCaseWords.txt In it is a list of words, all in caps. So, I found out that running the below in terminal, it will spit out those same words in lower case right there in the terminal. Cool! But what if I wanted to run something that would run on the actual file itself, or, create a second file with the lower case words?

Can anyone help?

cat UpperCaseWords.txt | tr '[:upper:]' '[:lower:]' | tr ' ' '\ > '
MarshaG63
QUOTE (Harrie @ Apr 9 2009, 08:53 AM) *
I have a file on my Desktop, UpperCaseWords.txt In it is a list of words, all in caps. So, I found out that running the below in terminal, it will spit out those same words in lower case right there in the terminal. Cool! But what if I wanted to run something that would run on the actual file itself, or, create a second file with the lower case words?

Can anyone help?

cat UpperCaseWords.txt | tr '[:upper:]' '[:lower:]' | tr ' ' '\ > '


Harrie, here are some more examples - I think you need to bypass the "cat" command, but also add a file name for the output. The cat command is used to output text in the file to the screen.

tr '[:upper:]' '[:lower:]' < UpperCaseWords.txt > lowercasewords.txt

That's just a guess.

http://www.cyberciti.biz/faq/how-to-use-li...nix-tr-command/
http://www.ivorde.ro/How_to_convert_lower_...command-96.html

MarshaG.
Harrie
That's one marvelous guess, Marsha! It worked like a charm, just beautiful!

Thanks a whole lot, I appreciate it, and when I finish with work and then play, I look forward to your links. Thanks again!
MarshaG63
QUOTE (Harrie @ Apr 9 2009, 06:29 PM) *
That's one marvelous guess, Marsha! It worked like a charm, just beautiful!

Thanks a whole lot, I appreciate it, and when I finish with work and then play, I look forward to your links. Thanks again!


COOL! IT WORKED!

Your welcome, Harrie ! happy.gif
Harrie
Very useful information in those links. Good read.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.