Sponsored Content
Top Forums Shell Programming and Scripting Need help in implementing logic Post 302509773 by sagarrd on Thursday 31st of March 2011 04:35:21 PM
Old 03-31-2011
Need help in implementing logic

i have following input file...
Code:
00290002STDR000000000000000000000000000EOD END TRANSACTION                            ^@^@^@^@^@^@^@^@^@^@^@^@^
00299998STDR070000000007000000000000000STANDING DEBITS                                ^@^@^@^@^@^@^@^@^@^@^@^@^
00299999STDR160000000016000000000000000STANDING CREDITS                               ^@^@^@^@^@^@^@^@^@^@^@^@^
00300000    000000000000000000000000002TDS 15H LIMIT DETAIL                           ^@^@^@^@^@^@^@^@^@^@^@^@^
00300010DFC 010000000001000000000000001CASH DEPOSIT                                   ^@^@^@^@^@^@^@^@^@^@^@^@^
00300015DFM 000000000001000000000000002MULTI DEPOSIT                                  ^@^@^@^@^@^@^@^@^@^@^@^@^
00300016DFC 010000000001000016000000002CASH DEPOSIT FOR FC ACCTS                      ^@^@^@^@^@^@^@^@^@^@^@^@^

$1 taken from user will be matched with 00016 (cut -c 4-8)
here i have to cut -c 40-86 to display CASH DEPOSIT FOR FC but the condition is that first 3 characters must be 003.

in short..
display CASH DEPOSIT FOR FC where $1=`cut c 4-8` and first 3 characters are 003...

Last edited by Franklin52; 04-01-2011 at 06:20 AM.. Reason: Please use code tags
 

We Also Found This Discussion For You

1. Shell Programming and Scripting

Help with implementing logging

I'm trying to add logging to an existing script which echos a number of lines to the screen. I've added a switch to the script that is going to suppress much of this output and put it in a file instead. The way I envisioned it was like this: $log would be set to either "" or the log files... (8 Replies)
Discussion started by: cheetobandito
8 Replies
START 
TRANSACTION(7) SQL Commands START TRANSACTION(7) NAME
START TRANSACTION - start a transaction block SYNOPSIS
START TRANSACTION [ transaction_mode [, ...] ] where transaction_mode is one of: ISOLATION LEVEL { SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED } READ WRITE | READ ONLY DESCRIPTION
This command begins a new transaction block. If the isolation level or read/write mode is specified, the new transaction has those charac- teristics, as if SET TRANSACTION [set_transaction(7)] was executed. This is the same as the BEGIN [begin(7)] command. PARAMETERS
Refer to SET TRANSACTION [set_transaction(7)] for information on the meaning of the parameters to this statement. COMPATIBILITY
In the standard, it is not necessary to issue START TRANSACTION to start a transaction block: any SQL command implicitly begins a block. PostgreSQL's behavior can be seen as implicitly issuing a COMMIT after each command that does not follow START TRANSACTION (or BEGIN), and it is therefore often called ``autocommit''. Other relational database systems might offer an autocommit feature as a convenience. The SQL standard requires commas between successive transaction_modes, but for historical reasons PostgreSQL allows the commas to be omit- ted. See also the compatibility section of SET TRANSACTION [set_transaction(7)]. SEE ALSO
BEGIN [begin(7)], COMMIT [commit(7)], ROLLBACK [rollback(7)], SAVEPOINT [savepoint(7)], SET TRANSACTION [set_transaction(7)] SQL - Language Statements 2010-05-14 START TRANSACTION(7)
All times are GMT -4. The time now is 01:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy