Sponsored Content
Top Forums Shell Programming and Scripting Changing one column of delimited file column to fixed width column Post 302327522 by kingpeejay on Monday 22nd of June 2009 04:12:59 AM
Old 06-22-2009
Bug edit columns in unix shell script

please disregard this post of mine.thanks!

Last edited by kingpeejay; 06-22-2009 at 05:33 AM.. Reason: wrong post
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Comparing column of variable length anf fixed width file

Hi, I have two input files. File1: ID Name Place 1-234~name1~Newyork 1-34~name2~Boston 1-2345~name3~Hungary File1 is a variable length file where each column is seperated by delimitter "~". File2: ID Country 1-34<<11 SPACES>>USA<<7 spaces>> 1-234<<10 SPACES>>UK<<8... (5 Replies)
Discussion started by: manneni prakash
5 Replies

2. Shell Programming and Scripting

edit entire column from a fixed-width file using awk or sed

Col1 Col2 Col3 Col4 12 Completed 08 0830 12 In Progress 09 0829 11 For F U 07 0828 Considering the file above, how could i replace the third column the most efficient way? The actual file size is almost 1G. I am... (10 Replies)
Discussion started by: tamahomekarasu
10 Replies

3. Shell Programming and Scripting

row to column and position data in to fixed column width

Dear friends, Below is my program and current output. I wish to have 3 or 4 column output in order to accomodate in single page. i do have subsequent command to process after user enter the number. Program COUNT=1 for MYDIR in `ls /` do VOBS=${MYDIR} echo "${COUNT}. ${MYDIR}" ... (4 Replies)
Discussion started by: baluchen
4 Replies

4. UNIX for Dummies Questions & Answers

Remove duplicates based on a column in fixed width file

Hi, How to output the duplicate record to another file. We say the record is duplicate based on a column whose position is from 2 and its length is 11 characters. The file is a fixed width file. ex of Record: DTYU12333567opert tjhi kkklTRG9012 The data in bold is the key on which... (1 Reply)
Discussion started by: Qwerty123
1 Replies

5. Shell Programming and Scripting

How to split a fixed width text file into several ones based on a column value?

Hi, I have a fixed width text file without any header row. One of the columns contains a date in YYYYMMDD format. If the original file contains 3 dates, I want my shell script to split the file into 3 small files with data for each date. I am a newbie and need help doing this. (14 Replies)
Discussion started by: bhanja_trinanja
14 Replies

6. Shell Programming and Scripting

To replace the value of the column in a fixed width file

I have a fixed with file with header & trailer length having the same length of the detail record file. The details record length of this file is 24, for Header and Trailer the records will be padded with spaces to match the record length of the file Currently I am adding 3 spaces in header... (14 Replies)
Discussion started by: ginrkf
14 Replies

7. Shell Programming and Scripting

Print column details from fixed width file using awk command

hi, i have a fixed width file with multiple columns and need to print data using awk command. i use: awk -F "|" '($5 == BH) {print $1,$2,$3}' <non_AIM target>.txt for a delimiter file. but now i have a fixed width file like below: 7518 8269511BH 20141224951050N8262 11148 8269511BH... (5 Replies)
Discussion started by: kcdg859
5 Replies

8. Shell Programming and Scripting

UNIX command -Filter rows in fixed width file based on column values

Hi All, I am trying to select the rows in a fixed width file based on values in the columns. I want to select only the rows if column position 3-4 has the value AB I am using cut command to get the column values. Is it possible to check if cut -c3-4 = AB is true then select only that... (2 Replies)
Discussion started by: ashok.k
2 Replies

9. UNIX for Beginners Questions & Answers

Replace a column in tab delimited file with column in other tab delimited file,based on match

Hello Everyone.. I want to replace the retail col from FileI with cstp1 col from FileP if the strpno matches in both files FileP.txt ... (2 Replies)
Discussion started by: YogeshG
2 Replies
Object::Pluggable::Pipeline(3pm)			User Contributed Perl Documentation			  Object::Pluggable::Pipeline(3pm)

NAME
Object::Pluggable::Pipeline - The plugin pipeline for Object::Pluggable. SYNOPSIS
use Object::Pluggable; use Object::Pluggable::Pipeline; use My::Plugin; my $self = Object::Pluggable->new(); # the following operations are presented in pairs # the first is the general procedure, the second is # the specific way using the pipeline directly # to install a plugin $self->plugin_add(mine => My::Plugin->new); $self->pipeline->push(mine => My::Plugin->new); # to remove a plugin $self->plugin_del('mine'); # or the object $self->pipeline->remove('mine'); # or the object # to get a plugin my $plug = $self->plugin_get('mine'); my $plug = $self->pipeline->get('mine'); # there are other very specific operations that # the pipeline offers, demonstrated here: # to get the pipeline object itself my $pipe = $self->pipeline; # to install a plugin at the front of the pipeline $pipe->unshift(mine => My::Plugin->new); # to remove the plugin at the end of the pipeline my $plug = $pipe->pop; # to remove the plugin at the front of the pipeline my $plug = $pipe->shift; # to replace a plugin with another $pipe->replace(mine => newmine => My::Plugin->new); # to insert a plugin before another $pipe->insert_before(mine => newmine => My::Plugin->new); # to insert a plugin after another $pipe->insert_after(mine => newmine => My::Plugin->new); # to get the location in the pipeline of a plugin my $index = $pipe->get_index('mine'); # to move a plugin closer to the front of the pipeline $pipe->bump_up('mine'); # to move a plugin closer to the end of the pipeline $pipe->bump_down('mine'); DESCRIPTION
Object::Pluggable::Pipeline defines the Plugin pipeline system for Object::Pluggable instances. METHODS
"new" Takes one argument, the Object::Pluggable object to attach to. "push" Takes at least two arguments, an alias for a plugin and the plugin object itself. Any extra arguments will be passed to the register method of the plugin object. If a plugin with that alias already exists, $@ will be set and "undef" will be returned. Otherwise, it adds the plugin to the end of the pipeline and registers it. This will yield a "plugin_add" event. If successful, it returns the size of the pipeline. my $new_size = $pipe->push($name, $plug, @register_args); "unshift" Takes at least two arguments, an alias for a plugin and the plugin object itself. Any extra arguments will be passed to the register method of the plugin object. If a plugin with that alias already exists, $@ will be set and "undef" will be returned. Otherwise, it adds the plugin to the beginning of the pipeline and registers it. This will yield a "plugin_add" event. If successful, it returns the size of the pipeline. my $new_size = $pipe->push($name, $plug, @register_args); "shift" Takes any number of arguments. The first plugin in the pipeline is removed. Any arguments will be passed to the unregister method of the plugin object. This will yield a "plugin_del" event. In list context, it returns the plugin and its alias; in scalar context, it returns only the plugin. If there were no elements, an empty list or "undef" will be returned. my ($plug, $name) = $pipe->shift(@unregister_args); my $plug = $pipe->shift(@unregister_args); "pop" Takes any number of arguments. The last plugin in the pipeline is removed. Any arguments will be passed to the unregister method of the plugin object. This will yield an "plugin_del" event. In list context, it returns the plugin and its alias; in scalar context, it returns only the plugin. If there were no elements, an empty list or "undef" will be returned. my ($plug, $name) = $pipe->pop(@unregister_args); my $plug = $pipe->pop(@unregister_args); "replace" Takes at least three arguments, the old plugin or its alias, an alias for the new plugin and the new plugin object itself. You can optionally pass two array references of arguments which will be delivered to the unregister method of the old plugin and the register method of the new plugin, respectively. If you only want to pass the latter, you can put "undef" in place of the former. If the old plugin doesn't exist, or if there is already a plugin with the new alias (besides the old plugin), $@ will be set and "undef" will be returned. Otherwise, it removes the old plugin (yielding an "plugin_del" event) and replaces it with the new plugin. This will yield an "plugin_add" event. If successful, it returns 1. my $success = $pipe->replace($name, $new_name, $new_plug, @unregister_args, @register_args); my $success = $pipe->replace($plug, $new_name, $new_plug, @unregister_args, @register_args); "insert_before" Takes at least three arguments, the plugin that is relative to the operation, an alias for the new plugin and the new plugin object itself. Any extra arguments will be passed to the register method of the new plugin object. If the first plugin doesn't exist, or if there is already a plugin with the new alias, $@ will be set and "undef" will be returned. Otherwise, the new plugin is placed just prior to the other plugin in the pipeline. If successful, it returns 1. my $success = $pipe->insert_before($name, $new_name, $new_plug, @register_args); my $success = $pipe->insert_before($plug, $new_name, $new_plug, @register_args); "insert_after" Takes at least three arguments, the plugin that is relative to the operation, an alias for the new plugin and the new plugin object itself. any extra arguments will be passed to the register method of the new plugin object. If the first plugin doesn't exist, or if there is already a plugin with the new alias, $@ will be set and "undef" will be returned. Otherwise, the new plugin is placed just after to the other plugin in the pipeline. If successful, it returns 1. my $success = $pipe->insert_after($name, $new_name, $new_plug, @register_args); my $success = $pipe->insert_after($plug, $new_name, $new_plug, @register_args); "bump_up" Takes one or two arguments, the plugin or its alias, and the distance to bump the plugin. The distance defaults to 1. If the plugin doesn't exist, $@ will be set and -1 will be returned, not undef. Otherwise, the plugin will be moved the given distance closer to the front of the pipeline. A warning is issued alerting you if it would have been moved past the beginning of the pipeline, and the plugin is placed at the beginning. If successful, the new index of the plugin in the pipeline is returned. my $pos = $pipe->bump_up($name); my $pos = $pipe->bump_up($plug); my $pos = $pipe->bump_up($name, $delta); my $pos = $pipe->bump_up($plug, $delta); "bump_down" Takes one or two arguments, the plugin or its alias, and the distance to bump the plugin. The distance defaults to 1. If the plugin doesn't exist, $@ will be set and -1 will be returned, not "undef". Otherwise, the plugin will be moved the given distance closer to the end of the pipeline. A warning is issued alerting you if it would have been moved past the end of the pipeline, and the plugin is placed at the end. If successful, the new index of the plugin in the pipeline is returned. my $pos = $pipe->bump_down($name); my $pos = $pipe->bump_down($plug); my $pos = $pipe->bump_down($name, $delta); my $pos = $pipe->bump_down($plug, $delta); "remove" Takes at least one argument, a plugin or its alias. Any arguments will be passed to the unregister method of the plugin object. If the plugin doesn't exist, $@ will be set and "undef" will be returned. Otherwise, the plugin is removed from the pipeline. This will yield an "plugin_del" event. In list context, it returns the plugin and its alias; in scalar context, it returns only the plugin. my ($plug, $name) = $pipe->remove($the_name, @unregister_args); my ($plug, $name) = $pipe->remove($the_plug, @unregister_args); my $plug = $pipe->remove($the_name, @unregister_args); my $plug = $pipe->remove($the_plug, @unregister_args); "get" Takes one argument, a plugin or its alias. If no such plugin exists, $@ will be set and "undef" will be returned. In list context, it returns the plugin and its alias; in scalar context, it returns only the plugin. my ($plug, $name) = $pipe->get($the_name); my ($plug, $name) = $pipe->get($the_plug); my $plug = $pipe->get($the_name); my $plug = $pipe->get($the_plug); "get_index" Takes one argument, a plugin or its alias. If no such plugin exists, $@ will be set and -1 will be returned, not "undef". Otherwise, the index in the pipeline is returned. my $pos = $pipe->get_index($name); my $pos = $pipe->get_index($plug); BUGS
None known so far. AUTHOR
Jeff "japhy" Pinyan, japhy@perlmonk.org. MAINTAINER
Chris "BinGOs" Williams, chris@bingosnet.co.uk. SEE ALSO
Object::Pluggable. POE::Component::IRC, perl v5.10.1 2010-10-09 Object::Pluggable::Pipeline(3pm)
All times are GMT -4. The time now is 11:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy