Sponsored Content
Top Forums Shell Programming and Scripting HELP !! Builting string in incremental order Post 302084448 by aigles on Friday 11th of August 2006 05:47:47 AM
Old 08-11-2006
Another way :

Code:
Prefix=citi${TSTAMP}
for file in $(ls ${Prefix}_*.trn | sort -k1.$((${#Prefix}+2))n)
do
   tr -d '\n' < $file >> $Prefix.trn
done

EDIT --
Correction of suffix for filenames (.DAT replaced by .trn)
Correction of redirect operator (> replaced by >>)


Jean-Pierre.

Last edited by aigles; 08-14-2006 at 06:44 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

output string in reversing order

If I have string { I_love_shell_scripts} anyone knows how to have output {stpircs_llehs_evol_I} by using shell and perl ?I know in perl, there is reverse() funcation, but can it be done by not using reverse()? (3 Replies)
Discussion started by: ccp
3 Replies

2. UNIX for Dummies Questions & Answers

How to change the order of a string ?

Hi , I want to change the order of a string using sed command . Is it possible ? $echo "abc123xyz" | sed 's/\()*\) \(*\)/\2\1/' abc123xyz $ echo "abc123xyz" |sed 's/\()*\) \(*\) \()*\)/\2\1\3/' abc123xyz I want to change the string , abc123xyz as xyz123abc . Is it... (5 Replies)
Discussion started by: rajavu
5 Replies

3. Shell Programming and Scripting

Incremental backup

Hi, I would like to create a daily incremental backup of a directory with all of the files within and add a timestamp (year-month-day) to the tar.gz file. I have the following, but it doesn't backup the inside files of the directory. #!/bin/bash tar -czf... (1 Reply)
Discussion started by: agasamapetilon
1 Replies

4. UNIX for Dummies Questions & Answers

incremental by 1

let says, i have this number as 000002080, i want to add 1 to make it 000002081, and then i want to add 1 to 000002082, add 1 to 000002083, 84. i=000002080 TOT=$(echo "scale=9; $i + 1" | bc) echo $TOT it shows 2081, i want to retain 000002081, 000002082, 000002082, 000002084. (2 Replies)
Discussion started by: tjmannonline
2 Replies

5. Shell Programming and Scripting

Finding a String and Replacing it with an incremental value

Hi Friends, I have a text file which has about 200,000 records in it. we have a string which repeats in each and every record. So we have to write a script in ksh which finds that string on each line and replaces it with a new string(incremental value) for a set every four records. To be... (12 Replies)
Discussion started by: vpv0002
12 Replies

6. Shell Programming and Scripting

print in incremental order a sentence

Dear help! I want to print The number i is number i let i=1 to 5 output should be like The number 1 is number 1 The number 2 is number 2 The number 3 is number 3 The number 4 is number 4 The number 5 is number 5 Would be gr8 if you mke this with awk Thanks (7 Replies)
Discussion started by: Indra2011
7 Replies

7. Shell Programming and Scripting

Swapping a string of numbers between higher and lower order values(HEX)

I have this below string in a variable cutString=21222222222222222122222222222222 this string is nothing but hex values depicted as below 21:22:22:22:22:22:22:22:21:22:22:22:22:22:22:22 so what i want to achieve is swap the lower order with higher order values in the... (3 Replies)
Discussion started by: vivek d r
3 Replies

8. Shell Programming and Scripting

Manipulate XML File Continous STRING by each Order Line using SHELL

heres sample File: <?xml version="1.0"?> <!DOCTYPE cXML SYSTEM "www"><cXML.............................................. <OrderRequest>USE UNIX.com</Extrinsic><Extrinsic name="UniqueName">Peter@UNIX.com</Extrinsic><Extrinsic name="ContractingEntity">UNIX... (3 Replies)
Discussion started by: Pete.kriya
3 Replies

9. Shell Programming and Scripting

sed string with any order

Hi, i have a strange prob. log file contains ip, protocol, user name, agent . these can be in any order. If log contains the above order able to fetch all details but if details are in diff order not able to fetch all details. using below command. grep -A50 "Entry " "/logs/file.log" \ |grep... (6 Replies)
Discussion started by: Satyak
6 Replies

10. UNIX for Beginners Questions & Answers

Incremental logic

Hi Guys, am trying to write logic to do incremental value using linux Example: a=00.00.00.01 My b should be like this b=00.00.00.02 and when it reaches 99 my b should look like this b=00.00.01.99 Appreciate your help guys Please use CODE tags when displaying sample input, sample... (14 Replies)
Discussion started by: buddi
14 Replies
XML::Filter::Sort::Buffer(3pm)				User Contributed Perl Documentation			    XML::Filter::Sort::Buffer(3pm)

NAME
XML::Filter::Sort::Buffer - Implementation class used by XML::Filter::Sort DESCRIPTION
The documentation is targetted at developers wishing to extend or replace this class. For user documentation, see XML::Filter::Sort. For an overview of the classes and methods used for buffering, see XML::Filter::Sort::BufferMgr. BUFFER LIFE CYCLE
A XML::Filter::Sort::Buffer object is created by a XML::Filter::Sort::BufferMgr object using the "new()" method. The XML::Filter::Sort object will then propagate any SAX events it receives, to the buffer object until the end of the record is reached. As each element is added to the buffer, its contents are compared to the sort key paths and the sort key values are extracted. When the end of the record is reached, the "close()" method is called. The return value from this method is the list of sort keys. The buffer manager will store the buffer until the end of the record sequence is reached. Then it will retrieve each buffer in order of the sort key values and call the buffer's "to_sax()" method to send all buffered events to the downstream handler. Following the call to "to_sax()", the buffer is discarded. No destructor method is used - everything is handled by Perl's garbage collector. DATA STRUCTURES
The buffer contains a 'tree' of SAX events. The tree is simply an array of 'nodes'. Text nodes are represented as scalars. Other nodes are represented as arrayrefs. The first element of a node array is a single character identifying the node type: e - element c - comment p - processing instruction The second element is the node data (the hash from the original SAX event). The child nodes of an element node are represented by the third element as an arrayref. For example, this XML: <person age="27"> <lastname>smith</lastname> </person> Would be buffered as this data structure: [ [ 'e', { 'Name' => 'person' 'Prefix' => '', 'LocalName' => 'person', 'NamespaceURI' => '', 'Attributes' => { '{}age' => { 'LocalName' => 'age', 'NamespaceURI' => '', 'Value' => '27', 'Prefix' => '', 'Name' => 'age' } }, }, [ " ", [ 'e', { 'Name' => 'lastname' 'Prefix' => '', 'LocalName' => 'lastname', 'NamespaceURI' => '', 'Attributes' => {}, }, [ 'smith' ] ], " ", ] ] ] COPYRIGHT
Copyright 2002 Grant McLean <grantm@cpan.org> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.4 2005-04-20 XML::Filter::Sort::Buffer(3pm)
All times are GMT -4. The time now is 05:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy