It sounds so easy to do.
I have a file thats laid out like this..
number text text text text (etc about 15 times with various text fields)
I want to take the first field, "number", subtract 100 from it, and then put it back in the file. a simple little manipulation of the first field in... (4 Replies)
Hello,
I have a korn shell string variable
str1 = "A,B,Z"
I would like to create another korn shell string variable
str2 = "letter = 'A' or letter = 'B' or letter = 'Z' "
Please help!
Thanks in advance
an UNIX newbie! (13 Replies)
Hey Guys,
Right i know how to alter a word to begin with a capital letter, i know how to remove unwanted characters and replace them with the relevant character however i don't now if there is a way to do them all in one line.
Code:
echo -n ${string:0:1} | tr a-z A-Z #convert first letter... (4 Replies)
if I have two string variable, how do I add one to anther.
like
a= "a"
b="b"
c=$a+$b
but that doesn't work.
Is there anyway to solve it.http://www.qtl.co.il/img/copy.pnghttp://www.google.com/favicon.icohttp://www.babylon.com/favicon.icohttp://www.morfix.com/favicon.ico (2 Replies)
Write a shell program to display the position of the right - most character in a given input string.
Example :
Input : RAHUL
Output : L is in the 5th position
also tell me how to count length of string and how to find the position of specific character in left most side.
Homework... (0 Replies)
hi all,
i am new to shell scripting and need help.
i have a string that stores the month in Jan/Feb/Mar format. i need to convert it to number like 01 for jan, 12 for dec etc.
i am using the following sed command,
echo "Enter a Month eg. Jan/Feb : "
read MONTHEND
... (9 Replies)
Hello,
I would like to make simple string manipulation but since i am new in shell scripting some strange stuff are uncomprehensible to me:
I would like to pick up the name of a file and put it in a variable:
shadok@computer:~$a= folder/fil*.dat
shadok@computer:~$echo $a... (3 Replies)
i have something like this...
echo "teCertificateId" | awk -F'Id' '{ print $1 }' | awk -F'te' '{ print $2 }'
Certifica
the awk should remove 'te' only if it is present at the start of the string.. anywhere else it should ignore it.
expected output is
Certificate (7 Replies)
Hi ,
I am getting a string like
aaa,bbb,sdsdad,sdfsdf,sdfsdfdsf,rtyrtyr,45654654,ddfdfdfgdfg,dfgdfgdg...........
Now what I need is to format it.
So after each nth comma I need one newline. So the above will look like
when n=3
aaa,bbb,sdsdad,
sdfsdf,sdfsdfdsf,rtyrtyr,... (4 Replies)
I'm making a little game in Perl, and I am trying to remove the first instance of a character in an arbitrary string. For example, if the string is
"cupcakes"and the user enters another string that contains letters from "cupcake" e.g:
"sake"the original string will now look like this (below)... (3 Replies)
Discussion started by: whyte_rhyno
3 Replies
LEARN ABOUT PHP
msgfmt_format_message
MSGFMT_FORMAT_MESSAGE(3) 1 MSGFMT_FORMAT_MESSAGE(3)MessageFormatter::formatMessage - Quick format message
Object oriented style
SYNOPSIS
publicstatic string MessageFormatter::formatMessage (string $locale, string $pattern, array $args)
DESCRIPTION
Procedural style
string msgfmt_format_message (string $locale, string $pattern, array $args)
Quick formatting function that formats the string without having to explicitly create the formatter object. Use this function when the
format operation is done only once and does not need and parameters or state to be kept.
PARAMETERS
o $locale
- The locale to use for formatting locale-dependent parts
o $pattern
- The pattern string to insert things into. The pattern uses an 'apostrophe-friendly' syntax; it is run through umsg_autoQuoteA-
postrophe before being interpreted.
o $args
- The array of values to insert into the format string
RETURN VALUES
The formatted pattern string or FALSE if an error occurred
EXAMPLES
Example #1
msgfmt_format_message(3) example
<?php
echo msgfmt_format_message("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree
", array(4560, 123, 4560/123));
echo msgfmt_format_message("de", "{0,number,integer} Affen auf {1,number,integer} Baumen sind {2,number} Affen pro Baum
", array(4560, 123, 4560/123));
?>
Example #2
OO example
<?php
echo MessageFormatter::formatMessage("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree
", array(4560, 123, 4560/123));
echo MessageFormatter::formatMessage("de", "{0,number,integer} Affen auf {1,number,integer} Baumen sind {2,number} Affen pro Baum
", array(4560, 123, 4560/123));
?>
The above example will output:
4,560 monkeys on 123 trees make 37.073 monkeys per tree
4.560 Affen auf 123 Baumen sind 37,073 Affen pro Baum
SEE ALSO msgfmt_create(3), msgfmt_parse(3), msgfmt_get_error_code(3), msgfmt_get_error_message(3).
PHP Documentation Group MSGFMT_FORMAT_MESSAGE(3)