I run these codes and worked, but the only change I made is use gawk or awk instead of nawk (I havenīt installed it). I think this probes your code works fine, I donīt now why run it in the other way failed to me.
Thatīs right durden, I had done that, I mean, replace the (-F,) to (-F"|"), in this way.
That's wrong, cgkmal. The "-F" switch is followed by the pattern to split on. It's a regular expression pattern and not a literal string. You can enclose it within double-quotes or single-quotes, but that doesn't make it a literal string. The character "|" has a special meaning in regular expression terminology; it is the "OR" operator.
If you want to specify the literal pipe character as the delimiter, then you'll have to remove the special meaning of "OR" operator. And you do that by escaping the OR operator like so "\|".
So your command line should be:
Quote:
And with this inputfile: I get every letter piped. ...
The OR operator "|", when supplied as a delimiter to the split function, works like the undef or null string. The net effect is that it splits on each character. Note how the operation on $F[1] worked only on the second character - that's because after the split, $F[1] was the character "R" or "r" of your inputfile.
Hi all,
I am trying to find a way to change first letter in a word from lower case to upper case. It should be done for each first word in text or in paragraph, and also for each word after punctuation like
. ; : ! ?I found the following command
sed -i 's/\s*./\U&\E/g' $@ filenamebut... (7 Replies)
Hi,
im able to search for string in a file (ex: grep -w "$a" input.txt). but i have to search for the uppercase of a string in a file where upper case of the file content matches something like below.
where upper("$a")== converted to upper case string in (input.txt)
can someone please provide... (5 Replies)
The title pretty much defines the problem. I have text files that are all in caps. I would like to convert them to lowercase, but have the first letter of the first word in each sentence in uppercase.
I already have SED on the server for fixing / tweaking text files, but I'm open to other... (5 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 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)
Hi I have two questions.
1. how to convert "EverythingIsFine" to "Everything Is Fine" in a txt file.
2. how to convert everything to upper case letter and reverse, I hope there is a general purpose script for this. (1 Reply)
If user chosen to tolower then it should convert file name to lower or vice versa. when file names converted it should put into appropriate subdirectories.
e.g when files converted it then seperate them out with file etension where it will seperate them out . such as file.pdf, phone.doc both... (1 Reply)