Sponsored Content
Top Forums Shell Programming and Scripting Pad zeroes first field in a Delimited file Post 302589430 by Chubler_XL on Wednesday 11th of January 2012 04:43:47 PM
Old 01-11-2012
Yes just use:
Code:
printf "%06d|%s\n", n, $0

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to trim the leading zeroes in a Currency field ?

How do I trim the leading zeroes, and (+,-) in the currency field ? I have a text file. Your bill of +00002780.96 for a/c no. 25287324 is due on 11-06. Your bill of +00422270.48 for a/c no. 28931373 is due on 11-06. I want the O/P file to be like. Your bill of 2780.96 for a/c no. 25287324... (22 Replies)
Discussion started by: Amruta Pitkar
22 Replies

2. Shell Programming and Scripting

Count field frequency in a '|' delimited file

I have a large file with fields delimited by '|', and I want to run some analysis on it. What I want to do is count how many times each field is populated, or list the frequency of population for each field. I am in a Sun OS environment. Thanks, - CB (3 Replies)
Discussion started by: ChicagoBlues
3 Replies

3. Shell Programming and Scripting

insert a field into a tab delimited file

Hello, Can someone help me to do this with awk or sed? I have a file with multiple lines, each line has many fields separated with a tab. I would like to add one more field holding 'na' in between the first and second fields. old file looks like, 1, field1 field2 field3 ... 2, field1... (7 Replies)
Discussion started by: ssshen
7 Replies

4. UNIX for Dummies Questions & Answers

Insert Field into a tab-delimited file

Hello, I have about 100 files in a directory with fields which are tab delimited. I would like to append the file name as the first field and it has to be done as many times as the total lines in the file. For example, myFile1.txt has the following data: 1 x y z 2 a b ... (5 Replies)
Discussion started by: Gussifinknottle
5 Replies

5. Shell Programming and Scripting

Remove leading zeroes in 2nd field using sed

Hi Forum. I tried searching the forum but couldn't find a solution for my question. I have the following data and would like to have a sed syntax to remove the leading zeroes from the 2nd field only: Before: 2010-01-01|123|1|1000|2000|500|1500|600|700... (18 Replies)
Discussion started by: pchang
18 Replies

6. UNIX for Dummies Questions & Answers

Trim and pad a field in the middle of unix file

Hello, I have a file with several lines and I need to trim and pad with spaces the data that are between position 6 and 15 included. Data in position 1 to 5 and after 15 could be anything, and should stay as they are. For instance, the following records in a file (underscore = space)... (4 Replies)
Discussion started by: BSF
4 Replies

7. Shell Programming and Scripting

sed command to remove the first field from a '|' delimited file

Hi I have a file with fields delimited by |. I need to remove the first field from the file. I tried cut but it just extracts that field. sample.output abc|100|name1 cde|200|name2 efg|300|name3 Output should be sample.output 100|name1 200|name2 300|name3 thanks Var (6 Replies)
Discussion started by: var285
6 Replies

8. Shell Programming and Scripting

Remove Last field from a delimited file

Hi, I have a '~' delimited file and i want to remove the last field using awk. Please find the sample records below: 1428128~1~0~1100426~003~50220~005~14~0~194801~11~0~3~14~0~50419052335~0~0820652001~2~00653862 ~0~1~0~00126~1~20000110~20110423~R~ ~0~Z~1662.94~ ~002041~0045~Z~... (3 Replies)
Discussion started by: Arun Mishra
3 Replies

9. Shell Programming and Scripting

How to pad zeroes based on input string?

Hello everyone, I am comparing two floating point numbers by storing them in seperate files and then using difference command to verify,it is working fine. But I want to compare two values which will come at 4 precision places. ex: file1 Date,Count,Checksum... (7 Replies)
Discussion started by: karthik adiga
7 Replies

10. Shell Programming and Scripting

Replace field in the delimited file

Hi, I have the requirement similar to the one mentioned in the below thread. https://www.unix.com/unix-for-dummies-questions-and-answers/128155-search-replace-string-only-particular-column-delimited-file.html The only difference is that I need to change the field for row 1,2 and the last... (14 Replies)
Discussion started by: chetanojha
14 Replies
GStreamer::Pad(3pm)					User Contributed Perl Documentation				       GStreamer::Pad(3pm)

NAME
GStreamer::Pad - Object contained by elements that allows links to other elements HIERARCHY
Glib::Object +----GStreamer::Object +----GStreamer::Pad METHODS
pad or undef = GStreamer::Pad->new ($name, $direction) o $name (string) o $direction (GStreamer::PadDirection) pad or undef = GStreamer::Pad->new_from_template ($templ, $name) o $templ (GStreamer::PadTemplate) o $name (string) boolean = $pad->accept_caps ($caps) o $caps (GStreamer::Caps) boolean = $pad->activate_pull ($active) o $active (boolean) boolean = $pad->activate_push ($active) o $active (boolean) $pad->set_active ($active) o $active (boolean) caps or undef = $srcpad->get_allowed_caps boolean = $pad->set_blocked ($blocked) o $blocked (boolean) caps = $pad->get_caps boolean = $pad->set_caps ($caps) o $caps (GStreamer::Caps or undef) flowreturn = $pad->chain ($buffer) o $buffer (GstBuffer) boolean = $pad->check_pull_range paddirection = $pad->get_direction boolean = $pad->event_default ($event) o $event (GstEvent) $pad->fixate_caps ($caps) o $caps (GStreamer::Caps) list = $pad->get_internal_links_default list = $pad->get_internal_links boolean = $pad->is_active boolean = $pad->is_blocked boolean = $pad->is_blocking Since: gst 0.10 boolean = $pad->is_linked iterator = $pad->iterate_internal_links Since: gst 0.10 iterator = $pad->iterate_internal_links_default Since: gst 0.10 boolean = $srcpad->link ($sinkpad) o $sinkpad (GStreamer::Pad) caps or undef = $pad->get_negotiated_caps caps = $pad->get_pad_template_caps padtemplate = $pad->get_pad_template boolean = $pad->pause_task boolean = $pad->peer_accept_caps ($caps) o $caps (GStreamer::Caps) pad = $pad->get_peer caps = $pad->peer_get_caps boolean = $pad->peer_query ($query) o $query (GstQuery) Since: gst 0.10 list = $pad->pull_range ($offset, $size) o $offset (64 bit unsigned) o $size (integer) flowreturn = $pad->push ($buffer) o $buffer (GstBuffer) boolean = $pad->push_event ($event) o $event (GstEvent) boolean = $pad->query ($query) o $query (GstQuery) boolean = $pad->query_default ($query) o $query (GstQuery) list = $pad->get_query_types_default list = $pad->get_query_types list = $pad->get_range ($offset, $size) o $offset (64 bit unsigned) o $size (integer) boolean = $pad->send_event ($event) o $event (GstEvent) boolean = $pad->start_task ($func, $data=undef) o $func (scalar) o $data (scalar) boolean = $pad->stop_task $srcpad->unlink ($sinkpad) o $sinkpad (GStreamer::Pad) PROPERTIES
'caps' (GStreamer::Caps : default undef : readable / private) The capabilities of the pad 'direction' (GStreamer::PadDirection : default "unknown" : readable / writable / construct-only / private) The direction of the pad 'template' (GStreamer::PadTemplate : default undef : readable / writable / private) The GstPadTemplate of this pad SIGNALS
linked (GStreamer::Pad, GStreamer::Pad) unlinked (GStreamer::Pad, GStreamer::Pad) request-link (GStreamer::Pad) boolean = have-data (GStreamer::Pad, GStreamer::MiniObject) ENUMS AND FLAGS
enum GStreamer::FlowReturn o 'custom-success-2' / 'GST_FLOW_CUSTOM_SUCCESS_2' o 'custom-success-1' / 'GST_FLOW_CUSTOM_SUCCESS_1' o 'custom-success' / 'GST_FLOW_CUSTOM_SUCCESS' o 'resend' / 'GST_FLOW_RESEND' o 'ok' / 'GST_FLOW_OK' o 'not-linked' / 'GST_FLOW_NOT_LINKED' o 'wrong-state' / 'GST_FLOW_WRONG_STATE' o 'unexpected' / 'GST_FLOW_UNEXPECTED' o 'not-negotiated' / 'GST_FLOW_NOT_NEGOTIATED' o 'error' / 'GST_FLOW_ERROR' o 'not-supported' / 'GST_FLOW_NOT_SUPPORTED' o 'custom-error' / 'GST_FLOW_CUSTOM_ERROR' o 'custom-error-1' / 'GST_FLOW_CUSTOM_ERROR_1' o 'custom-error-2' / 'GST_FLOW_CUSTOM_ERROR_2' enum GStreamer::PadDirection o 'unknown' / 'GST_PAD_UNKNOWN' o 'src' / 'GST_PAD_SRC' o 'sink' / 'GST_PAD_SINK' SEE ALSO
GStreamer, Glib::Object, GStreamer::Object COPYRIGHT
Copyright (C) 2005-2011 by the gtk2-perl team. This software is licensed under the LGPL. See GStreamer for a full notice. perl v5.14.2 2012-03-01 GStreamer::Pad(3pm)
All times are GMT -4. The time now is 12:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy