Sponsored Content
Top Forums Shell Programming and Scripting print all the rows from "BUY" Tag with "SELL" with Buy/sell tag at end Post 302330848 by r_t_1601 on Thursday 2nd of July 2009 01:19:22 PM
Old 07-02-2009
sory for the confusion the input and output is listed below

------
INPUT
=====
Code:
30/06/2009,NORMAL,ALL,ALL
BUY
1,CBLO/020709,T+0,30/06/2009,100.00,3.00,999835643.46,200906300000422,-, 15:04:42
2,CBLO/020709,T+0,30/06/2009,100.00,3.01,999835095.69,200906300000421,-, 15:04:42
3,CBLO/020709,T+0,30/06/2009,10.00,2.90,99984112.11,200906300000296,-, 13:32:34
4,CBLO/020709,T+0,30/06/2009,100.00,2.90,999841121.14,200906300000295,-, 13:32:34
5,CBLO/020709,T+0,30/06/2009,50.00,2.90,499920560.57,200906300000294,-, 13:32:34
6,CBLO/020709,T+0,30/06/2009,30.00,2.91,299952172.01,200906300000293,-, 13:32:34
SEL
1,CBLO/020709,T+0,30/06/2009,40.00,3.24,399928998.91,200906300000038,-, 09:47:22
2,CBLO/020709,T+0,30/06/2009,50.00,3.24,499911248.63,200906300000037,-, 09:47:22
3,CBLO/020709,T+0,30/06/2009,10.00,3.24,99982249.73,200906300000036,-, 09:47:22
4,CBLO/020709,T+0,30/06/2009,100.00,3.25,999821949.52,200906300000024,-, 09:31:09
5,CBLO/020709,T+0,30/06/2009,100.00,3.25,999821949.52,200906300000023,-, 09:31:09
6,CBLO/020709,T+0,30/06/2009,100.00,3.10,999830165.83,200906300000007,-, 09:11:55
7,CBLO/020709,T+0,30/06/2009,200.00,3.10,1999660331.67,200906300000006,-, 09:11:49
8,CBLO/020709,T+0,30/06/2009,200.00,3.05,1999665809.28,200906300000002,-, 09:11:28
390.00,800.00
3899368704.98,7998622703.09

OUTPUT
Code:
1,CBLO/020709,T+0,30/06/2009,100.00,3.00,999835643.46,200906300000422,-, 15:04:42,BUY
2,CBLO/020709,T+0,30/06/2009,100.00,3.01,999835095.69,200906300000421,-, 15:04:42,BUY
3,CBLO/020709,T+0,30/06/2009,10.00,2.90,99984112.11,200906300000296,-, 13:32:34,BUY
4,CBLO/020709,T+0,30/06/2009,100.00,2.90,999841121.14,200906300000295,-, 13:32:34,BUY
5,CBLO/020709,T+0,30/06/2009,50.00,2.90,499920560.57,200906300000294,-, 13:32:34,BUY
6,CBLO/020709,T+0,30/06/2009,30.00,2.91,299952172.01,200906300000293,-, 13:32:34,BUY
1,CBLO/020709,T+0,30/06/2009,40.00,3.24,399928998.91,200906300000038,-, 09:47:22,SELL
2,CBLO/020709,T+0,30/06/2009,50.00,3.24,499911248.63,200906300000037,-, 09:47:22,SELL
3,CBLO/020709,T+0,30/06/2009,10.00,3.24,99982249.73,200906300000036,-, 09:47:22,SELL
4,CBLO/020709,T+0,30/06/2009,100.00,3.25,999821949.52,200906300000024,-, 09:31:09,SELL
5,CBLO/020709,T+0,30/06/2009,100.00,3.25,999821949.52,200906300000023,-, 09:31:09,SELL
6,CBLO/020709,T+0,30/06/2009,100.00,3.10,999830165.83,200906300000007,-, 09:11:55,SELL
7,CBLO/020709,T+0,30/06/2009,200.00,3.10,1999660331.67,200906300000006,-, 09:11:49,SELL
8,CBLO/020709,T+0,30/06/2009,200.00,3.05,1999665809.28,200906300000002,-, 09:11:28,SELL


Last edited by vgersh99; 07-02-2009 at 03:07 PM.. Reason: code tags, PLEASE!
 

6 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

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

3. 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

4. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

5. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

6. Shell Programming and Scripting

find files in sub dir with tag & add "." at the beginning [tag -f "Note" . | xargs -0 {} mv {} .{}]

I am trying find files in sub dir with certain tags using tag command, and add the period to the beginning. I can't use chflags hidden {} cause it doesn't add period to the beginning of the string for web purpose. So far with my knowledge, I only know mdfind or tag can be used to search files with... (6 Replies)
Discussion started by: Nexeu
6 Replies
Dist::Zilla::Plugin::Git::Tag(3pm)			User Contributed Perl Documentation			Dist::Zilla::Plugin::Git::Tag(3pm)

NAME
Dist::Zilla::Plugin::Git::Tag - tag the new version VERSION
version 1.121820 SYNOPSIS
In your dist.ini: [Git::Tag] tag_format = v%v ; this is the default tag_message = v%v ; this is the default DESCRIPTION
Once the release is done, this plugin will record this fact in git by creating a tag. By default, it makes an annotated tag. You can set the "tag_message" attribute to change the message. If you set "tag_message" to the empty string, it makes a lightweight tag. It also checks before the release to ensure the tag to be created doesn't already exist. (You would have to manually delete the existing tag before you could release the same version again, but that is almost never a good idea.) Plugin options The plugin accepts the following options: o tag_format - format of the tag to apply. Defaults to "v%v", see "Formatting options" below. o tag_message - format of the tag annotation. Defaults to "v%v", see "Formatting options" below. Use "tag_message = " to create a lightweight tag. o time_zone - the time zone to use with %d. Can be any time zone name accepted by DateTime. Defaults to "local". o branch - which branch to tag. Defaults to current branch. o signed - whether to make a GPG-signed tag, using the default e-mail address' key. Consider setting "user.signingkey" if "gpg" can't find the correct key: $ git config user.signingkey 450F89EC Formatting options Some plugin options allow you to customize the tag content. You can use the following codes at your convenience: "%{dd-MMM-yyyy}d" The current date. You can use any CLDR format supported by DateTime. A bare %d means "%{dd-MMM-yyyy}d". %n A newline %N The distribution name "%{-TRIAL}t" Expands to -TRIAL (or any other supplied string) if this is a trial release, or the empty string if not. A bare %t means "%{-TRIAL}t". %v The distribution version METHODS
tag my $tag = $plugin->tag; Return the tag that will be / has been applied by the plugin. That is, returns "tag_format" as completed with the real values. AUTHOR
Jerome Quelin COPYRIGHT AND LICENSE
This software is copyright (c) 2009 by Jerome Quelin. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-30 Dist::Zilla::Plugin::Git::Tag(3pm)
All times are GMT -4. The time now is 09:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy