Sponsored Content
Full Discussion: repeat each record n times
Top Forums UNIX for Dummies Questions & Answers repeat each record n times Post 302238146 by radoulov on Friday 19th of September 2008 05:13:56 AM
Old 09-19-2008
And mine:

Code:
perl -pe'$_=$_ x5' file

Code:
ruby -pe'4.times{print}' file

Code:
awk '{while(++i<6)print;i=0}' file

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

splitting a record and adding a record to a file

Hi, I am new to UNIX scripting and woiuld appreicate your help... Input file contains only one (but long) record: aaaaabbbbbcccccddddd..... Desired file: NEW RECORD #new record (hardcoded) added as first record - its length is irrelevant# aaaaa bbbbb ccccc ddddd ... ... ... (1 Reply)
Discussion started by: rsolap
1 Replies

2. UNIX for Advanced & Expert Users

Print Full record and substring in that record

I have i got a requirement like below. I have input file which contains following fixed width records. 00000000000088500232007112007111 I need the full record and concatenated with ~ and characters from 1to 5 and concatenated with ~ and charactes from 10 to 15 The out put will be like... (1 Reply)
Discussion started by: ukatru
1 Replies

3. AIX

how would you know your server was rebooted 3 times or 5 times

Is there such location or command to know how many times did you reboot your server in that particular day?in AIX. (3 Replies)
Discussion started by: kenshinhimura
3 Replies

4. Shell Programming and Scripting

Reject the record if the record in the next line does not satisfy the pattern

Hi, I have a input file with the following entries: 1one 2two 3three 1four 2five 3six 1seven 1eight 1nine 2ten The output should be 1one 2two 3three 1four 2five 3six (2 Replies)
Discussion started by: supchand
2 Replies

5. Shell Programming and Scripting

Reject the record if the record in the next line does not begin with 2.

Hi, I have a input file with the following entries: 1one 2two 3three 1four 2five 3six 1seven 1eight 1nine 2ten 2eleven 2twelve 1thirteen 2fourteen The output should be: (5 Replies)
Discussion started by: supchand
5 Replies

6. Programming

Problem with implementing the times() function in C (struct tms times return zero/negative values)

Hello, i'm trying to implement the times() function and i'm programming in C. I'm using the "struct tms" structure which consists of the fields: The tms_utime structure member is the CPU time charged for the execution of user instructions of the calling process. The tms_stime structure... (1 Reply)
Discussion started by: g_p
1 Replies

7. Shell Programming and Scripting

How to compare current record,with next and previous record in awk without using array?

Hi! all can any one tell me how to compare current record of column with next and previous record in awk without using array my case is like this input.txt 0 32 1 26 2 27 3 34 4 26 5 25 6 24 9 23 0 32 1 28 2 15 3 26 4 24 (7 Replies)
Discussion started by: Dona Clara
7 Replies

8. Shell Programming and Scripting

Extract timestamp from first record in xml file and it checks if not it will replace first record

I have test.xml <emp><id>101</id><name>AAA</name><date>06/06/14 1811</date></emp> <Join><id>101</id><city>london</city><date>06/06/14 2011</date></join> <Join><id>101</id><city>new york</city><date>06/06/14 1811</date></join> <Join><id>101</id><city>sydney</city><date>06/06/14... (2 Replies)
Discussion started by: vsraju
2 Replies

9. Shell Programming and Scripting

Need code for updating second record to first record in shell scripting

Hi,, I have requirement that i need to get DISTINCT values from a table and if there are two records i need to update it to one record and then need to submit INSERT statements by using the updated value as a parameter. Here is the example follows.. SELECT DISTINCT ID FROM OFFER_GROUP WHERE... (1 Reply)
Discussion started by: Samah
1 Replies
dia2code(1)															       dia2code(1)

NAME
dia2code - Generate code from Dia files SYNOPSIS
dia2code [-t ada|c|cpp|cs|java|php|php5|python|ruby|shp|sql] [-d dir] [-nc] [-c] [-cl classlist] [-v] diagramfile [-h] [--help] DESCRIPTION
dia2code generates code from a Dia file containing a UML diagram. Output code can be: Ada, C, C++, C#, Java, PHP, PHP5, Python, Ruby, shapefiles and SQL. OPTIONS
-h --help Print help text and exit. -t ada|c|cpp|cs|java|php|php5|python|ruby|shp|sql Selects the output language, default is C++. -d dir Output generated files to <dir>, default is "." -nc Do not overwrite files that already exist. -cl classlist Generate code only for the classes specified in the comma-separated <classlist>. E.g: Base,Derived. -v Invert the class list selection. When used without -cl prevents any file from being created. -l licensefile Prepend the specified license to every source file generated. diagramfile The Dia file that holds the diagram to be read. AUTHOR
Written by Javier O'Hara <joh314@users.sourceforge.net> with contributions from Ruben Lopez <ryu@gpul.org> (C code generation), Chris McGee <sirnewton_01@yahoo.ca> (Dependencies, Associations, C++ Templates, SQL), Takashi Okamoto <toraneko@kun.ne.jp> (License inclusion mechanism), Thomas Preymesser <tp@odn.de> (Ada code generation), Jerome Slangen <jeromes@mail.be> (Wildcard class list mechanism), Takaaki Tateishi <> (Dynamic Shared Objects for dynamic code generator modules), Martin Vidner <mvidner@users.sourceforge.net> (Porting to libxml2). THANKS
Thanks to Collin Starkweather, Richard Torkar and Slush Gore for the extra help. REPORTING BUGS
Report bugs to <http://sourceforge.net/bugs/?func=addbug&group_id=15307>. COPYRIGHT
Copyright (C) 2000-2001 Javier O'Hara This is free software, and you are welcome to redistribute it under certain conditions; read the COPYING file for details. SEE ALSO
dia(1) ALSO SEE ALSO
The Dia homepage: <http://live.gnome.org/Dia> The dia2code homepage: <http://dia2code.sourceforge.net> September 2, 2001 dia2code(1)
All times are GMT -4. The time now is 09:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy