And, in those cases, what is supposed to happen? Does capitalization start with the first string and continue until the second string is seen on a subsequent line, or is capitalization only performed between an occurrence of the first string up to the next occurrence of the second string that appears on the same line.
And, on a line like:
is the output supposed to be:
or:
This User Gave Thanks to Don Cragun For This Post:
That's the result i needed. ( with capitalization only performed between an occurrence of the first string up to the next occurrence ) Thank you Don!.
The perl solution from Aia solved the issue.
You said that with the input:
you want the output:
and you said that Aia's perl script does exactly what you want. But both of Aia's perl scripts produce the following output from that input:
I'm not nearly as good at writing perl scripts as Aia is, but the following awk script seems to do what you have requested for every output you have specified with various sample inputs:
As always, if you want to try this on a Solaris/SunOS system, change awk to /usr/xpg4/bin/awk or nawk. I'm guessing this still doesn't really do what you want, but you still haven't given us a complete specification for what happens when the three patterns you showed us in your original post in this thread are not paired as shown in the examples in that post.
Shell : bash that comes with RHEL 6.7
I have SQL scripts like below. I want to convert all the text in these files to lower case except the strings enclosed within single quotes .
Any idea how I can achieve this ?
Sample text:
$ cat sample.txt
SELECT ... (6 Replies)
I have a large number of files in the standard subtitle format with the additional proviso that the files are bi-lingual i.e. English and a second language: in this case Hindi. A small sample is given below:
00 04 07 08
00 04 11 00
I mean very high fever...
He even vomited.
00 04 07 08
00... (6 Replies)
Hi :)
I have a .txt file with thousands of words.
I was wondering if i could use a simple sed or awk command to convert / replace all words in the text file to Title Case format ?
Example:
from:
this is line one
this is line two
this is line three
to desired output:
This Is Line... (8 Replies)
There is a script where we pass the parameter in lower case:
say: . ./scriptName pArameter
#!/bin/ksh
echo "`date` Entering $0 Reloading the $1 table "
mname1=$1
(code to login MYSQL Database)
Truncate table $mname1;
exit
!
Since now there is a limitaion of MYSQL that it accept... (5 Replies)
Hi,
I am trying to edit an XML file automatically but my regex and shell script knowledge is very limited. I would appreciate your help fellows.
The XML file has this structure:
<?xml version="1.0" encoding="UTF-8"?>
<map map_file="maps/world.swf" zoom="350%" zoom_x="-115%"... (1 Reply)
I've got:
$string =~ s/(\w+)/\u\L$1/g;
Which capitalizes each word in the string. The problem is if I have a string with an apostrophe the first letter after it gets capitalized as well.
So Bob's becomes Bob'S.
Thanks for any quick fixes! (4 Replies)
Hi All
I have a script which extracts values from a Database (A persons name) and puts it into a variable in my script IE: $NAME
However the Value in the DB is all in uppercase and contains the users first name and last name
EG:
> echo $NAME
GRAHAM BOYLE
>
What I need is only the... (7 Replies)
I have a package to install and the installation script which does it . The files/directories names in the script are all lower case but the actual package has everything in upper case - file names, directories . I don't want to rename directories and files in the package - it has a lot of them . ... (2 Replies)
Hi, I have a variable $Ctrcd which contains country names in upper case and i want to convert them into lower case. I have tried so many solutions from already existing threads but couldn't get the correct one.
Can anybody help me with this.....
Thanks a lot.. (2 Replies)