Let's say I write a simple script that contains the following:
date | awk '{print $1}'
date | awk '{print $2}'
Of course, when I run the script the output will look similar to:
Tue
Mar
What if I want my ouput to be on one line as follows:
Tue Mar
What changes would I need to... (2 Replies)
Hi,
I need to insert a line at a particular line number. I am using the below code:
sed $REV_LINO_NO" i\\
# $CURRENT_DATE $NAME Changed pwd for cindy\'s id" file > file1
This code works, but the formatting is not as I expected. For example, I get lines as shown below... (2 Replies)
hi
I have a string pattern like
...
...
000446448742 00432265 040520100408 21974435 DEWSWATER GARRIER AAG IK4000 N 017500180000000000000000077000000000100
000446448742 00580937 040520100408 32083576 PEWSWATER BARRIER DAG GK4000 ... (6 Replies)
Dear all
I require help with AWK regarding this situation
Input is :
fn1 12345
fn1 23456
fn3 231513
fn1 22325
fn3 123125
Desired output is
fn1 12345 23456 22325
fn3 231513 123125 (5 Replies)
when i try this awk its giving out put as below.
awk '!(/^$/||/--/||/selected/||/^ *$/){print $1}' tmp.txt
output
=====
1
2010-08-03-12.31.26.126000
how excluede the 1st line ? i mean i want output only 2nd line i.e 2010-08-03-12.31.26.126000; (5 Replies)
Hi all,
I'm writing a simple awk code:
awk 'BEGIN {FS="|"};{print "Type\tNumber\ttypes\tTotal";};{print $1, "\t", $2, "\t", $3, "\t", $4, "\t";}' db_query.txt
it gives me the result:
Type Number types Total
XXX 498.0 5100.0 5274.661
Type Number types Total... (7 Replies)
trying to write up a script to put the suffix back.
heres what I have but can't get it to do anything :(
would like it to be name.date.suffix
rsync -zrlpoDtub --suffix=".`date +%Y%m%d%k%M%S`.~" --bwlimit=1024 /mymounts/test1/ /mymounts/test2/
while IFS=. read -r -u 9 -d '' name... (1 Reply)
Hi all,
Is it possible to tell awk that the first line of text is a header and then print dashes after it is printed before it prints the rest of the text?
Note example below:
Source file:
Filesystem kbytes used avail capacity Mounted on
server-p01:/vol/vol_vol01/db01... (3 Replies)
Please help me to get required output for both scenario 1 and scenario 2 and need separate code for both scenario 1 and scenario 2
Scenario 1
i need to do below changes only when column1 is CR and column3 has duplicates rows/values. This inputfile can contain 100 of this duplicated rows of... (1 Reply)
Discussion started by: as7951
1 Replies
LEARN ABOUT OSX
locale::codes::langvar
Locale::Codes::LangVar(3pm) Perl Programmers Reference Guide Locale::Codes::LangVar(3pm)NAME
Locale::Codes::LangVar - standard codes for language variation identification
SYNOPSIS
use Locale::Codes::LangVar;
$lvar = code2langvar('acm'); # $lvar gets 'Mesopotamian Arabic'
$code = langvar2code('Mesopotamian Arabic'); # $code gets 'acm'
@codes = all_langvar_codes();
@names = all_langvar_names();
DESCRIPTION
The "Locale::Codes::LangVar" module provides access to standard codes used for identifying language variations, such as those as defined in
the IANA language registry.
Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default IANA language
registry codes will be used.
SUPPORTED CODE SETS
There are several different code sets you can use for identifying language variations. A code set may be specified using either a name, or
a constant that is automatically exported by this module.
For example, the two are equivalent:
$lvar = code2langvar('en','alpha-2');
$lvar = code2langvar('en',LOCALE_CODE_ALPHA_2);
The codesets currently supported are:
alpha
This is the set of alphanumeric codes from the IANA language registry, such as 'arevela' for Eastern Armenian.
This code set is identified with the symbol "LOCALE_LANGVAR_ALPHA".
This is the default code set.
ROUTINES
code2langvar ( CODE [,CODESET] )
langvar2code ( NAME [,CODESET] )
langvar_code2code ( CODE ,CODESET ,CODESET2 )
all_langvar_codes ( [CODESET] )
all_langvar_names ( [CODESET] )
Locale::Codes::LangVar::rename_langvar ( CODE ,NEW_NAME [,CODESET] )
Locale::Codes::LangVar::add_langvar ( CODE ,NAME [,CODESET] )
Locale::Codes::LangVar::delete_langvar ( CODE [,CODESET] )
Locale::Codes::LangVar::add_langvar_alias ( NAME ,NEW_NAME )
Locale::Codes::LangVar::delete_langvar_alias ( NAME )
Locale::Codes::LangVar::rename_langvar_code ( CODE ,NEW_CODE [,CODESET] )
Locale::Codes::LangVar::add_langvar_code_alias ( CODE ,NEW_CODE [,CODESET] )
Locale::Codes::LangVar::delete_langvar_code_alias ( CODE [,CODESET] )
These routines are all documented in the Locale::Codes::API man page.
SEE ALSO
Locale::Codes
The Locale-Codes distribution.
Locale::Codes::API
The list of functions supported by this module.
http://www.iana.org/assignments/language-subtag-registry
The IANA language subtag registry.
AUTHOR
See Locale::Codes for full author history.
Currently maintained by Sullivan Beck (sbeck@cpan.org).
COPYRIGHT
Copyright (c) 2011-2012 Sullivan Beck
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.16.2 2012-10-11 Locale::Codes::LangVar(3pm)