Sponsored Content
Full Discussion: Add lines into file
Top Forums Shell Programming and Scripting Add lines into file Post 73719 by Ygor on Friday 3rd of June 2005 12:31:15 PM
Old 06-03-2005
Try...
Code:
awk '{a[$1] = $2}
END{
  for(m=0; m<60; m++)
    for(s=0; s<60; s++) {
      k = sprintf("%02d:%02d", m, s)
      print k, a[k]+0
    }
}' file1 > file2

 

10 More Discussions You Might Find Interesting

1. HP-UX

Add a column at the end of all the lines in a file

Hi Guys, :D I am very much new to UNIX. I dont have much basics of coding in UNIX, so please help me out of thi ssituation. I have a file say for ex: ABC.dtd and it contains "|" delimited data as test1|testing|test3|moving past1|runing|test4|going I need to add a column at the end... (6 Replies)
Discussion started by: ruthless
6 Replies

2. Shell Programming and Scripting

Add Lines in middle of file

I need to add a new lines with certain data, to an existing file, every 5 lines in the file. There is no way to find any distinct charater pattern so I will have to do a line count and then insert the new line. I think using awk or sed is what I need to do. Any help is appreciated. Kunder (2 Replies)
Discussion started by: kunder
2 Replies

3. Shell Programming and Scripting

add lines in file with perl

How to search string like: a and replace to a a a : : a in a file with perl? Thanks, Grace (6 Replies)
Discussion started by: jinsh
6 Replies

4. Shell Programming and Scripting

XML file: add 100 lines

Hi Gurus, I have XML file which i want to add 100 lines.I have no idea in xml how to add or modify data .Any help should be appreciated. Thanks, Akil (6 Replies)
Discussion started by: akil
6 Replies

5. Shell Programming and Scripting

add few lines to a file in unix

Hi, I have an xml file <Disp x=y a=b Disp/> <Disp q=1 w=2 Disp/> ..... I want to add a new set in between like this for a set of 100 files. <Disp x=y a=b Disp/> <Disp k=1 z=2 Disp/> <Disp q=1 w=2 (7 Replies)
Discussion started by: naga_5star
7 Replies

6. Shell Programming and Scripting

How to add lines of a file and average them

I'm reading in numbers from a file and trying to add them together. Here is the code so far. I know the 1+2+3.... part is wrong. The file has five numbers in it with each number on its own line. The numbers are decimals if that matters. Thanks. while read EachLine do echo $EachLine done <... (6 Replies)
Discussion started by: AxlVanDamme
6 Replies

7. Shell Programming and Scripting

Extract some lines from one file and add those lines to current file

hi, i have two files. file1.sh echo "unix" echo "linux" file2.sh echo "unix linux forums" now the output i need is $./file2.sh unix linux forums (3 Replies)
Discussion started by: snreddy_gopu
3 Replies

8. Shell Programming and Scripting

How to add two common lines on entire file

Hi Hi i have 500 lines of file,each line i need to add another two lines also need to separate with one line for every 3 lines after adding two lines.How to achieve this using shell? For example: Input file : dn: uid=apple,dc=example,dc=com dn: uid=ball,dc=example,dc=com output:... (4 Replies)
Discussion started by: buzzme
4 Replies

9. UNIX for Dummies Questions & Answers

Add strings from one file at the end of specific lines in text file

Hello All, this is my first post so I don't know if I am doing this right. I would like to append entries from a series of strings (contained in a text file) consecutively at the end of specifically labeled lines in another file. As an example: - the file that contains the values to be... (3 Replies)
Discussion started by: gus74
3 Replies

10. Shell Programming and Scripting

Add 3 new lines for every line in a file

I have a file that I need to add 3 new lines of text for every line in the file - when I attempt the sed scripting below I keep getting 'command garbled' errors. Any suggestions would be greatly appreciated #!/bin/ksh list=`cat /export/home/list` for i in $list do sed ' a \... (7 Replies)
Discussion started by: bjdamon
7 Replies
zipios::ReferenceCount(3)				     Library Functions Manual					 zipios::ReferenceCount(3)

NAME
zipios::ReferenceCount - ReferenceCount is useful to ensure proper handling of the reference count for (objects of) classes handled through a SimpleSmartPointer. SYNOPSIS
#include <simplesmartptr.h> Public Member Functions ReferenceCount () Constructor intializes count to zero. ReferenceCount (const ReferenceCount &src) Copy-constructor intializes count to zero. const ReferenceCount & operator= (const ReferenceCount &src) The assignment operator doesn't copy the reference count, it leaves it unchanged. Friends class SimpleSmartPointer< Type > SimpleSmartPointer needs to be a friend to invoke the private ref() and unref() methods. class SimpleSmartPointer< const Type > class FileEntry Type also needs to be a friend to invoke the private ref() and unref() methods, in case Type doesn't want to inherit ReferenceCount and thus needs to invoke ref() and unref() through forwarding member functions. class Bogus Detailed Description template<class Type>class zipios::ReferenceCount< Type > ReferenceCount is useful to ensure proper handling of the reference count for (objects of) classes handled through a SimpleSmartPointer. Subclassing ReferenceCount is all a class needs to become ready for being handled by SimpleSmartPointer. Another way is to add a ReferenceCount member variable to a class and write two methods 'void ref() const' and 'unsigned int unref() const' that invoke the same methods in the ReferenceCount variable. Definition at line 99 of file simplesmartptr.h. Constructor &; Destructor Documentation template<class Type> zipios::ReferenceCount< Type >::ReferenceCount () [inline] Constructor intializes count to zero. Definition at line 122 of file simplesmartptr.h. template<class Type> zipios::ReferenceCount< Type >::ReferenceCount (const ReferenceCount< Type > &src) [inline] Copy-constructor intializes count to zero. It doesn't copy it from src. Definition at line 126 of file simplesmartptr.h. Member Function Documentation template<class Type> const ReferenceCount& zipios::ReferenceCount< Type >::operator= (const ReferenceCount< Type > &src) [inline] The assignment operator doesn't copy the reference count, it leaves it unchanged. Definition at line 130 of file simplesmartptr.h. Friends And Related Function Documentation template<class Type> friend class FileEntry [friend] Type also needs to be a friend to invoke the private ref() and unref() methods, in case Type doesn't want to inherit ReferenceCount and thus needs to invoke ref() and unref() through forwarding member functions. Definition at line 117 of file simplesmartptr.h. template<class Type> friend class SimpleSmartPointer< Type > [friend] SimpleSmartPointer needs to be a friend to invoke the private ref() and unref() methods. Definition at line 102 of file simplesmartptr.h. Author Generated automatically by Doxygen for Zipios++ from the source code. Zipios++ Mon Oct 10 2011 zipios::ReferenceCount(3)
All times are GMT -4. The time now is 05:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy