Sponsored Content
Top Forums Shell Programming and Scripting awk - treat multiple delimiters as one Post 27396 by oombera on Friday 30th of August 2002 12:12:34 PM
Old 08-30-2002
*beaming at the praise* Smilie Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cutting a file with multiple delimiters into columns

Hi All I have recently had to start using Unix for work and I have hit brick wall with this prob.... I have a file that goes a little something like this.... EUR;EUR;EUR:USD:USD;USD;;;EUR/USD;XAU/AUD;XAU/EUR;XAU/AUD,GBP/BOB,UAD/XAU;;;1.11;2.22;3.33;4.44;5.55;6.66;;; is it possible to... (7 Replies)
Discussion started by: luckycharm
7 Replies

2. Shell Programming and Scripting

AWK with multiple delimiters

I have the following string sample: bla bla bla bla bla I would like to extract the "123" using awk. I thought about awk -F"]" '{ print $1 }' but it doesn't work Any ideas ? (7 Replies)
Discussion started by: gdub
7 Replies

3. Shell Programming and Scripting

Sorting based on multiple delimiters

Hello, I have data where words are separated by a delimiter. In this case "=" The number of delimiters in a line can vary from 4to 8. The norm is 4. Is it possible to have a script where the file could be separated starting with highest number of delimiters and ending with the lowest An... (8 Replies)
Discussion started by: gimley
8 Replies

4. Shell Programming and Scripting

Sorting problem: Multiple delimiters, multiple keys

Hello If you wanted to sort a .csv file that was filled with lines like this: <Ticker>,<Date as YYYYMMDD>,<Time as H:M:S>,<Volume>,<Corr> (H : , M, S: ) by date, does anybody know of a better solution than to turn the 3rd and 4th colons of every line into commas, sorting on four keys,... (20 Replies)
Discussion started by: Ryan.
20 Replies

5. Shell Programming and Scripting

treating multiple delimiters[solved]

Hi, I need to display the last column value in the below o/p. sam2 PS 03/10/11 0 441 Unable to get o/p with this awk code awk -F"+" '{ print $4 }' pwdchk.txt I need to display 441(in this eg.) and also accept it as a variable to treat it with if condition and take a decision.... (1 Reply)
Discussion started by: sam_bd
1 Replies

6. Shell Programming and Scripting

awk multiple delimiters

Hi Folks, This is the first time I ever encountered this situation My input file is of this kind cat input.txt 1 PAIXAF 0 1 1 -9 0 0 0 1 2 0 2 1 2 1 7 PAIXEM 0 7 1 -9 1 0 2 0 1 2 2 1 0 2 9 PAKZXY 0 2 1 -9 2 0 1 1 1 0 1 2 0 1 Till the sixth column (which is -9), I want my columns to... (4 Replies)
Discussion started by: jacobs.smith
4 Replies

7. Shell Programming and Scripting

Editing phone number with multiple delimiters

Hello all I have a data base of information that is formatted like so: JSD4863 XXX-XX-XXXX DOE, JOHN C JR-II BISS CPSC BS INFO TECH 412/779-9445 I need the last four digits of the phone number. However, many lines contain 'garbage data' that I'm not interested in. So i used a 'for loop'... (7 Replies)
Discussion started by: smartSometimes
7 Replies

8. Shell Programming and Scripting

awk script modification - treat certain files differently

awk 'BEGIN{OFS=","} FNR == 1 {if (NR > 1) {print fn,fnr,nl} fn=FILENAME; fnr = 1; nl = 0} {fnr = FNR} /UNUSUAL/ && /\.gz/ ~ /FILENAME/ {nl++} <'{system ("gunzip -cd FILENAME")}' END ... (2 Replies)
Discussion started by: SkySmart
2 Replies

9. UNIX for Beginners Questions & Answers

How to append the multiple Delimiters up to requirement?

HI All, How to append the multiple delimiters to at end the file up to 69 fields. FinalDelimiter Count is 69 recrod Delimeter count is 10 so 69-10=59 this script will add upto 59 Delimiters to that records. this script will check each and every record in a file and append the delimiters... (4 Replies)
Discussion started by: vinod.peddiredd
4 Replies

10. Shell Programming and Scripting

Getting fields from a file having multiple delimiters

Hi All, I have a file with a single row having the following text ABC.ABC.ABC,Database,New123,DBNAME,F,ABC.ABC.ABC_APP,"@FUNCTION1("ENT1") ,@FUNCTION2("ENT2")",R, I want an output in the following format ABC.ABC.ABC DBNAME ABC.ABC.ABC_APP '@FUNCTION1("ENT1")... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies
GConf(3pm)						User Contributed Perl Documentation						GConf(3pm)

NAME
Gnome2::GConf - Perl wrappers for the GConf configuration engine. SYNOPSIS
use Gnome2::GConf; my $client = Gnome2::GConf::Client->get_default; my $app_key = "/apps/myapp/mykey"; $client->add_dir($app_key, 'preload-none'); # add a notify for the key my $notify_id = $client->notify_add($app_key, sub { my ($client, $cnxn_id, $entry) = @_; return unless $entry->{value}; if ($entry->{value}->{type} eq 'string') { printf "key '%s' changed to '%s' ", $entry->{key}, $entry->{value}->{value}; } }); my $string = $client->get_string($app_key); $string = 'some string' unless $string; $client->set($app_key, { type => 'string', data => $string }); # set a schema for the key $client->set_schema ($app_key, { type => 'string', locale => 'C', short_desc => 'Some key.', long_desc => 'This key does something.', owner => 'some_program' }); # remove the notification callback $client->notify_remove($notify_id); ABSTRACT
Perl bindings to the 2.2 series of the GConf configuration engine libraries, for use with gtk2-perl. DESCRIPTION
This module allows you to use the GConf configuration system in order to store/retrieve the configuration of an application. The GConf system is a powerful configuration manager based on a user daemon that handles a set of key and value pairs, and notifies any changes of the value to every program that monitors those keys. GConf is used by GNOME 2.x. To discuss gtk2-perl, ask questions and flame/praise the authors, join gtk-perl-list@gnome.org at lists.gnome.org. Find out more about Gnome at http://www.gnome.org. DIFFERENT DATA TYPES
Some opaque data types in GConf are not registered inside the Glib type system. Thus, they have been implemented in a more perlish way, when possible, for the sake of coherency and following the principle of least surprise for the perl developer. These changes try to preserve semantics, to add syntactic sugar and to remove the need for accessor methods. GConfEntry See Gnome2::GConf::Entry GConfValue See Gnome2::GConf::Value GConfChangeSet See Gnome2::GConf::ChangeSet GConfSchema See Gnome2::GConf::Schema DIFFERENT CALL SIGNATURES
Reflecting the changes operated for the data types, some methods that use those type have had the call signature modified. GConfNotifyFunc In C, the function passed to "Gnome2::GConf::notify_add" must have the following signature: void (GConfNotifyFunc *) (GConfClient * client, guint cnxn_id, GConfEntry * entry); Where "GConfEntry" is a container for the key/value pair. Since in perl there's no "GConfEntry" (see above), the "entry" parameter is an hashref. GConfClient::get GConfClient::set In C, these accessor methods return/use a "GConfValue". In perl, they return/use an hashref. See Gnome2::GConf::Value GConfClient::get_list GConfClient::set_list These accessor methods use a string for setting the type of the lists (lists may have values of only one type), and an arrayref containing the values. GConfClient::get_pair GConfClient::set_pair These accessor methods use two hashref (representing "GConfValue"s) for the "car" and the "cdr" parameters. GConfClient::get_schema GConfClient::set_schema Similarly to the get/set pair above, these two methods return/use an hashref. See Gnome2::GConf::Schema. GConfClient::commit_change_set In C, this method return a boolean value (TRUE on success, FALSE on failure). On user request (using the boolean parameter "remove_committed"), it also returns the "GConfChangeSet", pruned of the successfully committed keys. In perl, this method returns a boolean value both in scalar context or if the user sets to FALSE the "remove_committed" parameter; in array context or if the user requests the uncommitted keys, returns both the return value and the pruned "GConfChangeSet". SEE ALSO
perl(1), Glib(3pm). AUTHOR
Emmanuele Bassi <ebassi@gmail.com> gtk2-perl created by the gtk2-perl team: http://gtk2-perl.sf.net COPYRIGHT AND LICENSE
Copyright 2003-2006 by Emmanuele Bassi This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. perl v5.14.2 2007-09-29 GConf(3pm)
All times are GMT -4. The time now is 01:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy