Sponsored Content
Top Forums Shell Programming and Scripting each line as 20digit long append zero "0" in front Post 302233563 by RahulJoshi on Monday 8th of September 2008 04:00:10 AM
Old 09-08-2008
each line as 20digit long append zero "0" in front

i have an ip file like
121
1213412
34345353
long file
want to made each line as 20digit long append zero "0" in front

as 121
become
00000000000000000121
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

sed append "\n" to end of every line in file

I know it sounds simple, but I want to e-mail the last 6 lines of a log file, which I have tailed into logresults.txt. I'm using echo -e "Subject:server results\nFrom:server log <user@domain.com>\n"`cat logresults.txt` | sendmail -t user@domain.com which works, but the body of the e-mail has... (4 Replies)
Discussion started by: unclecameron
4 Replies

3. Shell Programming and Scripting

SED or AWK "append line to the previous line"

Hi, How can I remove the line beak in the following case if the line begin with the special char “;”? TEXT Text;text ;text Text;text;text I want to convert the text to: Text;text;text Text;text;text I have already tried to use... (31 Replies)
Discussion started by: research3
31 Replies

4. Shell Programming and Scripting

append "awk command" to the end of each line

hi; this is my qqq.mos: l ./gcsw 86.0.0.1 'lt all;l+;lset SectorPort=860 Tilt 861;l-' l ./gcsw 86.0.0.2 'lt all;l+;lset SectorPort=862 Tilt 863;l-' l ./gcsw 86.0.0.3 'lt all;l+;lset SectorPort=864 Tilt 865;l-' ... i want to append;l nawk 'NR==14 && $NF!="Set."{print "l ./gcsw "r"... (4 Replies)
Discussion started by: gc_sw
4 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

7. UNIX for Beginners Questions & Answers

VI command "line too long"

Hello, I had posted this initially in the UNIX for dummies forum which is now locked to new posts. I have a machine running IRIX and I need to edit a text file on the terminal but I get a "line too long" error when using the vi command. The text file in question is tens of thousands in lines so... (7 Replies)
Discussion started by: James C
7 Replies

8. Shell Programming and Scripting

Append a line "while read line"

Hello everyone, I want to process a data file using bash, I would like add a new line RIGHT after the time when i know "another variable met a value" Like this: while read line do ... if ; then #Append a new line "===" to input.txt file after $line position #break fi done <... (11 Replies)
Discussion started by: fongthai
11 Replies

9. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies

10. Shell Programming and Scripting

Failure: if grep "$Var" "$line" inside while read line loop

Hi everybody, I am new at Unix/Bourne shell scripting and with my youngest experiences, I will not become very old with it :o My code: #!/bin/sh set -e set -u export IFS= optl="Optl" LOCSTORCLI="/opt/lsi/storcli/storcli" ($LOCSTORCLI /c0 /vall show | grep RAID | cut -d " "... (5 Replies)
Discussion started by: Subsonic66
5 Replies
std::front_insert_iterator< _Container >(3)		     Library Functions Manual		       std::front_insert_iterator< _Container >(3)

NAME
std::front_insert_iterator< _Container > - SYNOPSIS
Inherits std::iterator< output_iterator_tag, void, void, void, void >. Public Types typedef _Container container_type typedef void difference_type typedef output_iterator_tag iterator_category typedef void pointer typedef void reference typedef void value_type Public Member Functions front_insert_iterator (_Container &__x) front_insert_iterator & operator* () front_insert_iterator & operator++ () front_insert_iterator operator++ (int) front_insert_iterator & operator= (const typename _Container::value_type &__value) front_insert_iterator & operator= (typename _Container::value_type &&__value) Protected Attributes _Container * container Detailed Description template<typename _Container>class std::front_insert_iterator< _Container > Turns assignment into insertion. These are output iterators, constructed from a container-of-T. Assigning a T to the iterator prepends it to the container using push_front. Tip: Using the front_inserter function to create these iterators can save typing. Definition at line 493 of file stl_iterator.h. Member Typedef Documentation template<typename _Container > typedef _Container std::front_insert_iterator< _Container >::container_type A nested typedef for the type of whatever container you used. Definition at line 501 of file stl_iterator.h. typedef void std::iterator< output_iterator_tag , void , void , void , void >::difference_type [inherited] Distance between iterators is represented as this type. Definition at line 125 of file stl_iterator_base_types.h. typedef output_iterator_tag std::iterator< output_iterator_tag , void , void , void , void >::iterator_category [inherited] One of the tag types. Definition at line 121 of file stl_iterator_base_types.h. typedef void std::iterator< output_iterator_tag , void , void , void , void >::pointer [inherited] This type represents a pointer-to-value_type. Definition at line 127 of file stl_iterator_base_types.h. typedef void std::iterator< output_iterator_tag , void , void , void , void >::reference [inherited] This type represents a reference-to-value_type. Definition at line 129 of file stl_iterator_base_types.h. typedef void std::iterator< output_iterator_tag , void , void , void , void >::value_type [inherited] The type 'pointed to' by the iterator. Definition at line 123 of file stl_iterator_base_types.h. Constructor &; Destructor Documentation template<typename _Container > std::front_insert_iterator< _Container >::front_insert_iterator (_Container &__x) [inline], [explicit] The only way to create this iterator is with a container. Definition at line 504 of file stl_iterator.h. Member Function Documentation template<typename _Container > front_insert_iterator& std::front_insert_iterator< _Container >::operator* () [inline] Simply returns *this. Definition at line 542 of file stl_iterator.h. template<typename _Container > front_insert_iterator& std::front_insert_iterator< _Container >::operator++ () [inline] Simply returns *this. (This iterator does not move.) Definition at line 547 of file stl_iterator.h. template<typename _Container > front_insert_iterator std::front_insert_iterator< _Container >::operator++ (int) [inline] Simply returns *this. (This iterator does not move.) Definition at line 552 of file stl_iterator.h. template<typename _Container > front_insert_iterator& std::front_insert_iterator< _Container >::operator= (const typename _Container::value_type &__value) [inline] Parameters: __value An instance of whatever type container_type::const_reference is; presumably a reference-to-const T for container<T>. Returns: This iterator, for chained operations. This kind of iterator doesn't really have a position in the container (you can think of the position as being permanently at the front, if you like). Assigning a value to the iterator will always prepend the value to the front of the container. Definition at line 526 of file stl_iterator.h. Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ Tue Jun 10 2014 std::front_insert_iterator< _Container >(3)
All times are GMT -4. The time now is 06:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy