04-09-2012
selective replacement of delimiter
I have a file with two fields seperated by comma
data looks like below with the header
Quote:
name,desc
base,180x150, 160x600 and 728x90
gold,160x600,728x90
The o/p should look like this
Quote:
name|desc
base|180x150, 160x600 and 728x90
gold|160x600,728x90
Basically, the req is to replace only the first occuring comma with pipe
can we do this with any commands
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
We have umask 022 in /etc/profile for security reasons.
But I want have some other umask for selected users. how to achieve this?
Regards (3 Replies)
Discussion started by: baanprog
3 Replies
2. Shell Programming and Scripting
Dear all,
i have a proble.
in my input file i have records with delimiter like
aa-------bb------cc--vghjav---ef----kjd
dj--------ih------yy--ujdjkkl---dd----jid
now i want to replace the delimiter "-" with "~"
i have used a command i.e
cat FILENAME | tr "-" "~" >> Newfile
this command... (3 Replies)
Discussion started by: panknil
3 Replies
3. Shell Programming and Scripting
Hi,
I have a string like ABC.123.XYZ-A1-B2-P1-C4. I want to delimit the string based on "-" and then get result as only two strings. One with string till last hyphen and other with value after last hyphen... For this case, it would be something like first string as "ABC.123.XYZ-A1-B2-P1" and... (6 Replies)
Discussion started by: gupt_ash
6 Replies
4. Shell Programming and Scripting
Hello,
I'm new to this forum but this seems like the place to ask this question.
I have a pipe delimited data file with the fields except for the header being encased in double quotes. I found out that some of the fields have an trash pipe within the data itself. I'd like to conditionally... (4 Replies)
Discussion started by: samahs
4 Replies
5. Shell Programming and Scripting
Hi all,
I have a number of strings like below:
//mnt/autocor/43°13'(33")W/
and i'm trying to get the numbers in this string, for example
431333
please help
thanks ahead (14 Replies)
Discussion started by: sunnydanniel
14 Replies
6. UNIX for Dummies Questions & Answers
Hi all
:wall:
Can anyone advise how do I use ls to do a selective amd sorted listing of file that I want to have as below?
Am looking for files that are named as log_<nnnn>.txt, where <nnnn> are numeric, i.e. I want to have a listing sorted from the newest to the oldest of files that... (7 Replies)
Discussion started by: newbie_01
7 Replies
7. Shell Programming and Scripting
Hi
I am having a code snippet
grant permission to all user
sts|ln|uSe|PSG
sajncht|se|Use|PPSPSG
psg|ln|use|TSPSG
sts_user.Me revoke
I need to change all occurance of use (uSe,Use,use) with USE. I am using the following sed command for this
sed 's//USE/g' s_sample.txt
Output: (7 Replies)
Discussion started by: sudeep.id
7 Replies
8. UNIX for Dummies Questions & Answers
i have a large sequence of format
sat_1_g3_g_0_8540 . A 1 15501 . . . ID=sat_1_g3_g_0_8540;parentName=sat_1_g3_g_0_8540;Al=sat_1_g2_g_0_8540;
sat_1_g3_g_2_8510 . C 1 25501 . . . ... (11 Replies)
Discussion started by: siya@
11 Replies
9. Shell Programming and Scripting
Hi,
I have a No Delimiter variable length text file with following schema -
Column Name Data length
Firstname 5
Lastname 5
age 3
phoneno1 10
phoneno2 10
phoneno3 10
sample data - ... (16 Replies)
Discussion started by: Gaurav Martha
16 Replies
10. Shell Programming and Scripting
Hi,
Extremely new to Perl scripting, but need a quick fix without using TEXT::CSV
I need to read in a file, pass any delimiter as an argument, and convert it to bar delimited on the output. In addition, enclose fields within double quotes in case of any embedded delimiters.
Any help would... (2 Replies)
Discussion started by: JPB1977
2 Replies
LEARN ABOUT SUSE
pango::fontdescription
Pango::FontDescription(3) User Contributed Perl Documentation Pango::FontDescription(3)
NAME
Pango::FontDescription
HIERARCHY
Glib::Boxed
+----Pango::FontDescription
METHODS
fontdescription = Pango::FontDescription->new
double = Pango->PANGO_PIXELS ($d)
o $d (double)
$desc->set_absolute_size ($size)
o $size (double)
Since: pango 1.8
boolean = $desc->better_match ($old_match, $new_match)
o $old_match (Pango::FontDescription or undef)
o $new_match (Pango::FontDescription)
boolean = $desc1->equal ($desc2)
o $desc2 (Pango::FontDescription)
string = $desc->get_family
$desc->set_family ($family)
o $family (string)
$desc->set_family_static ($family)
o $family (string)
fontdescription = Pango::FontDescription->from_string ($str)
o $str (string)
gravity = $desc->get_gravity
Since: pango 1.16
$desc->set_gravity ($gravity)
o $gravity (Pango::Gravity)
Since: pango 1.16
integer = $desc->hash
$desc->merge ($desc_to_merge, $replace_existing)
o $desc_to_merge (Pango::FontDescription)
o $replace_existing (boolean)
$desc->merge_static ($desc_to_merge, $replace_existing)
o $desc_to_merge (Pango::FontDescription)
o $replace_existing (boolean)
double = Pango->pixels ($d)
o $d (double)
double = Pango->scale
double = Pango->scale_large
double = Pango->scale_medium
double = Pango->scale_small
double = Pango->scale_x_large
double = Pango->scale_x_small
double = Pango->scale_xx_large
double = Pango->scale_xx_small
fontmask = $desc->get_set_fields
integer = $desc->get_size
boolean = $desc->get_size_is_absolute
Since: pango 1.8
$desc->set_size ($size)
o $size (integer)
stretch = $desc->get_stretch
$desc->set_stretch ($stretch)
o $stretch (Pango::Stretch)
style = $desc->get_style
$desc->set_style ($style)
o $style (Pango::Style)
string = $desc->to_filename
string = $desc->to_string
$desc->unset_fields ($to_unset)
o $to_unset (Pango::FontMask)
variant = $desc->get_variant
$desc->set_variant ($variant)
o $variant (Pango::Variant)
weight = $desc->get_weight
$desc->set_weight ($weight)
o $weight (Pango::Weight)
ENUMS AND FLAGS
flags Pango::FontMask
o 'family' / 'PANGO_FONT_MASK_FAMILY'
o 'style' / 'PANGO_FONT_MASK_STYLE'
o 'variant' / 'PANGO_FONT_MASK_VARIANT'
o 'weight' / 'PANGO_FONT_MASK_WEIGHT'
o 'stretch' / 'PANGO_FONT_MASK_STRETCH'
o 'size' / 'PANGO_FONT_MASK_SIZE'
o 'gravity' / 'PANGO_FONT_MASK_GRAVITY'
enum Pango::Gravity
o 'south' / 'PANGO_GRAVITY_SOUTH'
o 'east' / 'PANGO_GRAVITY_EAST'
o 'north' / 'PANGO_GRAVITY_NORTH'
o 'west' / 'PANGO_GRAVITY_WEST'
o 'auto' / 'PANGO_GRAVITY_AUTO'
enum Pango::Stretch
o 'ultra-condensed' / 'PANGO_STRETCH_ULTRA_CONDENSED'
o 'extra-condensed' / 'PANGO_STRETCH_EXTRA_CONDENSED'
o 'condensed' / 'PANGO_STRETCH_CONDENSED'
o 'semi-condensed' / 'PANGO_STRETCH_SEMI_CONDENSED'
o 'normal' / 'PANGO_STRETCH_NORMAL'
o 'semi-expanded' / 'PANGO_STRETCH_SEMI_EXPANDED'
o 'expanded' / 'PANGO_STRETCH_EXPANDED'
o 'extra-expanded' / 'PANGO_STRETCH_EXTRA_EXPANDED'
o 'ultra-expanded' / 'PANGO_STRETCH_ULTRA_EXPANDED'
enum Pango::Style
o 'normal' / 'PANGO_STYLE_NORMAL'
o 'oblique' / 'PANGO_STYLE_OBLIQUE'
o 'italic' / 'PANGO_STYLE_ITALIC'
enum Pango::Variant
o 'normal' / 'PANGO_VARIANT_NORMAL'
o 'small-caps' / 'PANGO_VARIANT_SMALL_CAPS'
enum Pango::Weight
o 'thin' / 'PANGO_WEIGHT_THIN'
o 'ultralight' / 'PANGO_WEIGHT_ULTRALIGHT'
o 'light' / 'PANGO_WEIGHT_LIGHT'
o 'book' / 'PANGO_WEIGHT_BOOK'
o 'normal' / 'PANGO_WEIGHT_NORMAL'
o 'medium' / 'PANGO_WEIGHT_MEDIUM'
o 'semibold' / 'PANGO_WEIGHT_SEMIBOLD'
o 'bold' / 'PANGO_WEIGHT_BOLD'
o 'ultrabold' / 'PANGO_WEIGHT_ULTRABOLD'
o 'heavy' / 'PANGO_WEIGHT_HEAVY'
o 'ultraheavy' / 'PANGO_WEIGHT_ULTRAHEAVY'
SEE ALSO
Pango, Glib::Boxed
COPYRIGHT
Copyright (C) 2003-2009 by the gtk2-perl team.
This software is licensed under the LGPL. See Pango for a full notice.
perl v5.12.1 2010-07-05 Pango::FontDescription(3)