Could any one tell me how to read and match multiple lines in perl? Did this code below still work in this situation?
while (<FILE>) {
if (/ /) {
}
}
Thanks a lot! (5 Replies)
Hi,
Currently I am coding up a nasty way of reading file input using *cat* rather than *read*. My text input looks like
TextA 100
TextB 110
TextC 120
Currently I am using cat |while read line to read the first column and second column fields.
cat foo.txt|while read line
do
... (1 Reply)
Hi, Guys
I am new to shell programming and just get stuck with one simple question. please kindly help.
According to the tutorial here, we can do something like
for NODE in "ABC 10" "EFG 20"
do
set -- $NODE
echo "letter is $1, number is $2"
done
And the result will... (3 Replies)
Hi all,
I am just trying to read the contents of a file. basically this file has a list of dat files. then i want to access these dat files n execute a script on them one by one using a loop.
i hav e written like this
ls -l | cut -c 58-88 > file1.txt
while
do
arr1="$( sed -n '1p'... (7 Replies)
I have one long line text with semicolon used as separator between values in that line. Now, I want to separate the line into multiple line right after every 29th field.
example input line:
... (2 Replies)
I have one long line text with semicolon used as separator between values in that line. Now, I want to separate the line into multiple line right after every 29th field.
example input line:
... (1 Reply)
I am trying to create a script which will read 2 files and use the lines of file 1 for each line on file 2.
here's my sample code
cat $SBox |
while read line
do
cat $Date |
while read line
do $SCRIPTEXE <line from first file> $2 <line from 2nd file>
... (12 Replies)
Hello community,
what I need to do is read 2 rows at time from a file. I have this simple solution:
File to read:
LINE1
LINE2
LINE3
LINE4
LINE5
LINE6
LINE7
LINE8Read routine:#!/bin/ksh
sed '1,3d' /out.txt | while read line; do
read line2
echo $line $line2
doneResult:LINE1... (5 Replies)
GM,
I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed.
I am assuming that sed, awk or even perl could do what I need.
I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
How to read multiple files at simultaneously? (1 Reply)
Discussion started by: Priyanka_M
1 Replies
LEARN ABOUT PHP
locale_compose
LOCALE_COMPOSE(3) 1 LOCALE_COMPOSE(3)Locale::composeLocale - Returns a correctly ordered and delimited locale ID
Object oriented style
SYNOPSIS
publicstatic string Locale::composeLocale (array $subtags)
DESCRIPTION
Procedural style
string locale_compose (array $subtags)
Returns a correctly ordered and delimited locale ID the keys identify the particular locale ID subtags, and the values are the associated
subtag values.
PARAMETERS
o $subtags
- an array containing a list of key-value pairs, where the keys identify the particular locale ID subtags, and the values are the
associated subtag values.
Note
The 'variant' and 'private' subtags can take maximum 15 values whereas 'extlang' can take maximum 3 values.e.g. Variants are
allowed with the suffix ranging from 0-14. Hence the keys for the input array can be variant0, variant1, ...,variant14. In
the returned locale id, the subtag is ordered by suffix resulting in variant0 followed by variant1 followed by variant2 and
so on.
The 'variant', 'private' and 'extlang' multiple values can be specified both as array under specific key (e.g. 'variant')
and as multiple numbered keys (e.g. 'variant0', 'variant1', etc.).
RETURN VALUES
The corresponding locale identifier.
EXAMPLES
Example #1
locale_compose(3) example
<?php
$arr = array(
'language'=>'en' ,
'script' =>'Hans' ,
'region' =>'CN',
'variant2'=>'rozaj' ,
'variant1'=>'nedis' ,
'private1'=>'prv1' ,
'private2'=>'prv2'
);
echo locale_compose( $arr );
?>
Example #2
OO example
<?php
$arr = array(
'language'=>'en' ,
'script' =>'Hans' ,
'region' =>'CN',
'variant2'=>'rozaj' ,
'variant1'=>'nedis' ,
'private1'=>'prv1' ,
'private2'=>'prv2'
);
echo Locale::composeLocale( $arr );
?>
The above example will output:
Locale: en_Hans_CN_nedis_rozaj_x_prv1_prv2
SEE ALSO locale_parse(3).
PHP Documentation Group LOCALE_COMPOSE(3)