Grep range of lines to print a line number on match


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Grep range of lines to print a line number on match
# 8  
Old 04-09-2013
If you want to print line number and the matching pattern: $x,xxx.xx
Code:
awk '/\$/{ match ($0, /\$[ ]*[0-9,]*[.][0-9]*/); print NR, substr($0, RSTART, RLENGTH) }' file.txt

This User Gave Thanks to Yoda For This Post:
# 9  
Old 04-09-2013
Code:
sed -n '
  line1,line2{
    /pattern/{
      #
      q
     }
   }
 ' file

This User Gave Thanks to DGPickett For This Post:
# 10  
Old 04-10-2013
All,

Thanks for all your replies.....

Sorry for not being descriptive initially, let me try this time....

Basically, I am trying to print this page (besides many pages i am able to) with all the transactions listed till the line total amount in "$" amount. A sample data is posted above.

For this i am defining the start of this specific page based on the match as follows....
Code:
Page(n)_Start = Line number of last occurrence of the match "Purchases and Adjustments" in the whole input file.

Code:
Page(n)_End = Line number of Fixed string match "Fees" - 1 in the input file

(This should ideally print lines till the total "$" amount I am interested in.)

I am able to this fine but sometimes (different input file) there is some junk data between the "$" amount and the "Page(n)_End" which I don't want to be displayed and hence I am trying to see if there is way to print the line number of this match "$" amount between "Page(n)_Start" and "Page(n)_End" and either make that line number the Actual/New "Page(n)_End" or print only till that "$" amount line.

Details of the Match "$" amount:-
It starts with a "$" character and rest are always numbers but it could have any numbers of characters.
This is just an example: -
Code:
$ x,xxx.xx

The reason I am trying to search for this match between specific lines is because such matches are in multiples in the input file.


Please let me know if need more details....

Thanks again
# 11  
Old 04-10-2013
Quote:
Originally Posted by Kevin Tivoli
All,

Thanks for all your replies.....

Sorry for not being descriptive initially, let me try this time....

Basically, I am trying to print this page (besides many pages i am able to) with all the transactions listed till the line total amount in "$" amount. A sample data is posted above.
No, a sample is not posted above. All that you have shown us is part of a page 3 and part of a page 4 of a sample of a single transaction. You have not shown us anything that contains "_Start", "_End", "Purchases and Adjustments", or any other string you say you're looking for (except for the "$").
Quote:
For this i am defining the start of this specific page based on the match as follows....
Code:
Page(n)_Start = Line number of last occurrence of the match "Purchases and Adjustments" in the whole input file.

Code:
Page(n)_End = Line number of Fixed string match "Fees" - 1 in the input file

(This should ideally print lines till the total "$" amount I am interested in.)

I am able to this fine but sometimes (different input file) there is some junk data between the "$" amount and the "Page(n)_End" which I don’t want to be displayed and hence I am trying to see if there is way to print the line number of this match "$" amount between "Page(n)_Start" and "Page(n)_End" and either make that line number the Actual/New "Page(n)_End" or print only till that "$" amount line.

Details of the Match "$" amount:-
It starts with a "$" character and rest are always numbers but it could have any numbers of characters.
This is just an example: -
Code:
$ x,xxx.xx

The reason I am trying to search for this match between specific lines is because such matches are in multiples in the input file.


Please let me know if need more details....

Thanks again
It appears that you are asking us to help you produce an extremely inefficient way to separate statements into separate files or to discard unwanted text between statements and just print the statements from a file (or from multiple files) containing multiple statements. You say that only numbers follow the "$", but that is not true ("," and "." are not numbers). And why do we care? The only $ in the entire sample you have shown us is $ you want to find. So, my script gave you the line numbers of all lines containing a $. If there are multiple statements (or transactions) in your input file and you have set $start in your shell to be the 1st line of a transaction and you just want the line number of the 1st line after that that contains a $, try:
Code:
awk -F'$' -v low="$start" 'NF<2 || NR<low{next}{print NR; exit}' sample.txt

If you'd like us to help you create a script that will throw away everything between "transactions" or split "transactions" into separate files efficiently, then give us a real example and an accurate description of how to identfy the 1st and last lines of a "transaction", and then describe what you want to be done with the "transactions" found.
This User Gave Thanks to Don Cragun For This Post:
# 12  
Old 04-10-2013
Appreciate for your response... I am sure my approach is not efficient enough. I am a complete novice in scripting. I am just a beginner and practicing few things to pick up. For this one I am basically playing around with my own monthly bank statements (text file) to filter out unwanted data and put them in to another text file and then import it in to excel columns filtering out by type of transactions (different categories (columns) like Household, Health , travel etc., etc.,...

I am attaching a complete sample text file.

There are mainly three sections I am interested in and want these sections to be separated out in to another file.

1. Payments and Other Credits :- (Top section - Lines 53-58 in the sample data example)
2. Purchases and Adjustments :- (Middle section - Lines60-61, 110-167 in the sample data example)
3. Fees :-( Bottom section - Lines 178-196 in the sample data example)

Hope this helps. Please let me know if need more information...

Thank You
# 13  
Old 04-10-2013
Yeah, cool, text mining. You have to disassemble your internal personal mental process as with your eyes you find the data you want and ignore the data you do not want, so you can code a robust and effective tactic for mining out the hunks you want.

To make parsing easier, sometimes it is good to preprocess out blank lines, long white spaces, boilerplate text, etc., so you have a simpler problem left. Sometimes multiple passes are good, getting all the common bits and then going back for the detail lines, pasting the common bits on their details, resuting in lines like rows of a denormalized table in a database.

If your take your text, paste it into an HTML formatted email, you can mark it up, copy it and paste the html with markup into the forum directly, so we can see what you want to mine.

Output format desired is good to know, too.
This User Gave Thanks to DGPickett For This Post:
# 14  
Old 04-10-2013
Thank You, I am posting the data as instructed..


HTML Code:
**************************** Page 1 ****************************
   
   
   
   
   
   
   
   
                                  FIRSTNAME LASTNAME
                                  Account Number: xxxx xxxx xxxx  xxxx
                                  June 9 - July 10, 2012 
   
      Account Information:
      www.xxxxxxxxxxxx.com         Payment   Information                                                   Account   Summary
   
      Mail billing inquiries to:   New Balance Total.....................................................................$1,123.69 Previous Balance........................$2,277.64
      Bank of Xxxxxxx              Current Payment Due ......................................................................$33.00 Payments and Other Credits........... - 2,536.16
      P.O. Box xxxxxx                                                                                      Purchases and Adjustments.............1,350.74
      XX Xxxx, XX xxxxx-xxxx
                                   Total Minimum Payment Due............................................................$33.00 Fees Charged.................................................31.47
      Mail payments to:            Payment Due Date..........................................................................8/7/12 Interest Charged...............................................0.00
      Bank of Xxxxxxx
      P.O. Box xxxxxx              Late Payment Warning:  If we do not receive your Total Minimum Payment by New Balance Total ........................$1,123.69
      Xxxxxx, XX xxxxx-xxxx        the date listed above, you may have to pay a late fee of up to  $35.00 .
   
      Customer Service:            Total Minimum Payment Warning:  If you make only the Total Minimum      Total Credit Line............................$5,000.00
      1.XXX.XXX.XXXX               Payment each period, you will pay more in interest and it will take you longer Total Credit Available.....................$3,876.31
                                   to pay off your balance. For example:                                   Cash Credit Line ..............................$500.00
      (1.XXX.XXX.XXXX TTY)                                                                                 Portion of Credit Available for Cash....$500.00
   
                                      If you make no        You will payoff       And you will end         Statement Closing Date ...................7/10/12
                                     additional charges      the balance      up paying an estimated       Days in Billing Cycle ..................................32
                                       using this card      shown  on this            total of
                                    and each month you    statement in about
                                            pay
   
                                        Only the Total          11 years             $2,471.20
   
                                      Minimum Payment
                                          $41.76              36 months              $1,503.36
                                                                                 (Savings = $967.84)
   
   
                                   If you would like information about credit counseling services, call
                                   1-XXX-XXX-XXXX.
   
   
         Transactions
   
         Transaction Posting                                                               Reference     Account
         Date       Date          Description                                              Number        Number                 Amount           Total
                                  Payments and Other Credits
                    06/18         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   2459          XXXX                 - 247.10
   
                    07/09         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   4383          XXXX                  - 12.06
         07/09      07/10         PAYMENT - ELECTRONIC                                     0050                             - 2,277.00
                                                                                                                                           - $2,536.16
   
                                  Purchases and Adjustments
         06/09      06/11         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   7683          XXXX                    2.50
                                  continued on next page...
   
   
   
   
   
                      08   001123690000330000227700000426428597547XXXX
   
   
   
                     BANK OF XXXXXXX                                         Account Number:  XXXX XXXX XXXX  XXXX  
                     P.O. BOX XXXXXX
                     XXXXXX, XX XXXXX-XXXX
                                                                             New Balance Total...........................................................$1,123.69
                                                                             Total Minimum Payment Due...................................................33.00
                                                                                Payment Due Date  ...................................................08/07/12
   
   
                   FIRSTNAME LASTNAME                                             Enter payment amount   $
                                                                                                                             .
                   XXX STREET ADDRESS
                   STATE XX  XXXXX-XXXX 
                                                                                 Check here for a change of mailing address or phone numbers.
                                                                                 Please provide all corrections on the reverse side.
                                                                             Mail this coupon along with your check payable to: XXXX of Xxxxxxx
   
   
                                                     A524022250A                0887597547XXXXC
  **************************** Page 2 ****************************
  **************************** Page 3 ****************************
   
   
   
   
   
   
   
   
                                      XXXX XXXX XXXX  XXXX
                                      June 9 - July 10, 2012
                                      Page 3 of 6  
   
         Transactions   continued
   
         Transaction Posting                                                                Reference    Account
         Date       Date           Description                                              Number       Number                 Amount            Total
   
                                   Purchases and Adjustments
         06/09      06/11          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   7907         XXXX                     1.25
         06/09      06/11          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   6291         XXXX                   21.28
         06/09      06/11          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   0917         XXXX                     8.43
         06/12      06/13          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   5704         XXXX                     1.25
         06/12      06/13          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   4753         XXXX                   42.83
                                   ESH0RU69AA8
         06/14      06/16          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   8560         XXXX                  120.82
         06/15      06/16          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   5185         XXXX                   26.42
   
         06/16      06/18          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   4709         XXXX                   33.53
         06/16      06/18          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   1396         XXXX                     1.25
         06/16      06/18          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   1388         XXXX                     2.50
         06/16      06/18          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   1466         XXXX                   63.57
         06/16      06/18          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   8903         XXXX                  114.51
         06/17      06/18          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   7934         XXXX                     7.14
         06/18      06/19          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   7627         XXXX                     4.67
                                   762
         06/19      06/19          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   4738         XXXX                   48.73
                                   8220111103449627
         06/18      06/20          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   9884         XXXX                     1.90
         06/22      06/23          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   2647         XXXX                     5.76
                                   08515951181MVRYW000687675
         06/22      06/25          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   5841         XXXX                  101.74
         06/23      06/25          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   6295         XXXX                   21.41
   
         06/23      06/25          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   6295         XXXX                   31.12
         06/23      06/25          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   0648         XXXX                   11.94
         06/23      06/25          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   1999         XXXX                   64.07
                                   XXXX
         06/23      06/25          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   1967         XXXX                    34.66
                                   98201772CVI
         06/24      06/26          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   6354         XXXX                   56.31
         06/24      06/26          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   1248         XXXX                     2.12
         06/24      06/26          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   7511         XXXX                   40.11
         06/24      06/26          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   6708         XXXX                     2.50
         06/24      06/26          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   6732         XXXX                     2.50
         06/27      06/29          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   1955         XXXX                     1.25
         06/27      06/29          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   2029         XXXX                     1.25
         07/01      07/02          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   4282         XXXX                   53.72
         07/01      07/02          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   0914         XXXX                   19.99
   
                                   71674450194044186116
         07/03      07/05          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   0311         XXXX                   11.06
         07/03      07/05          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   5163         XXXX                   27.41
                                   08515951181MVRYW000809736
         07/04      07/05          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   0332         XXXX                     6.40
         07/04      07/05          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   0688         XXXX                   10.00
         07/04      07/06          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   3898         XXXX                  119.80
         07/04      07/06          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   3948         XXXX                   38.60
         07/06      07/07          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   0704         XXXX                   17.90
         07/06      07/09          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   9563         XXXX                   97.50
         07/07      07/09          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   4468         XXXX                   39.99
                                   08515951181MVRYW000761525
         07/08      07/09          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   5393         XXXX                   14.13
         07/08      07/09          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                   3611         XXXX                   14.92
                                   08515951181MVRYW000665299
   
                                                                                                                                            $1,350.74
  **************************** Page 4 ****************************
   
   
   
   
         Transactions   continued
   
         Transaction Posting                                                                Reference    Account
         Date       Date           Description                                              Number       Number                 Amount            Total
   
                                   Fees
         07/07      07/07          LATE FEE FOR PAYMENT DUE 07/07                           3214                                22.00
         07/10      07/10          CREDIT PROTECTION PLUS XXX.XXX.XXXX                      500P                                  9.47
                                   TOTAL FEES FOR THIS PERIOD                                                                                  $31.47
   
                                   Interest Charged
   
         07/10      07/10          Interest Charged on Purchases                                                                  0.00
         07/10      07/10          Interest Charged on Balance Transfers                                                          0.00
         07/10      07/10          Interest Charged on Dir Dep&Chk CashAdv                                                        0.00
         07/10      07/10          Interest Charged on Bank Cash Advances                                                         0.00
                                   TOTAL INTEREST FOR THIS PERIOD                                                                               $0.00
   
   
                                                      2012 Totals Year-to-Date
   
                                    Total fees charged in 2012                              $122.93
   
                                    Total interest charged in 2012                             $0.00
   
   
   
         Interest  Charge  Calculation
         Your Annual Percentage Rate (APR) is the annual interest rate on your account.
   
                                                                     Annual    Promotional   Promotional  Promotional     Balance         Interest
                                                                   Percentage   Transaction    Offer ID    Rate End      Subject to     Charges by
                                                                      Rate         Type                      Date         Interest      Transaction
                                                                                                                            Rate           Type
   
                             Purchases                               20.99%V                                               $0.00          $0.00
                                    Promotional APR                   0.00%     PUR, WT     XXXX-XXXXX   09/10/2012                       $0.00
                             Balance Transfers                       20.99%V                                               $0.00          $0.00
                             Direct Deposit and Check Cash           24.99%V                                               $0.00          $0.00
                             Advances
                             Bank Cash Advances                      24.99%V                                               $0.00          $0.00
   
         APR Type Definitions: Promotional Transaction Types: PUR = Purchase, WT = Non-Bank Wire Transfer; Daily Interest Rate Type: V= Variable Rate (rate may vary)
   
   
   
   
   
         Rewards
                                                      BANKXXXXXCARD CASH REWARDS
                                                          10.70  BASE EARNED THIS MONTH
                                                           5.64  BONUS THIS MONTH
                                                            .00  REDEEMED
                                                         205.24  TOTAL AVAILABLE
                                                      VISIT xxxxxxxxxxx.COM/CASHREWARDS
   
   
         Of Special Interest
   
         Discover the convenience of paperless statements: enjoy easy organization of your account statements, review your statement and transactions sooner, and
         reduce your risk of mail fraud and identity theft - all while taking another step towards a greener lifestyle. Simply sign in to your online banking account at
         www.xxxxxxxxxxxx.com and click the green leaf “go paperless” icon to get started.
  **************************** Page 5 ****************************
   
   
      Enjoy a low 0%  promotional                                                                                                           1030
      APR through your statement
                                                FIRSTNAME LASTNAME                                                 Check not valid after 9/9/12
      Closing Date in May 2013 on
                                                STREET ADDRESS
      the enclosed checks when
                                                STATE XX  XXXXX-XXXX                                         DATE                             62-16
      used by September 9, 2012.                                                                                                               311
                                                                                                              Offer ID XXXX-XXXXX
      When your promotional offer               PAY TO THE
                                                ORDER OF                      V      O       I    D                              $
      expires, these balances will be
      charged a variable APR,
                                                                                                                                          DOLLARS
      currently 24.99%.
                                                               XXXCard Services, X.X.
                                                               XXXXXXXXXX, XXXXXXXX
      These checks can be a great
                                                FOR
      financial tool to help you pay
      down your balances faster. à
                                                     A031100160A08770194992865C1030
      Call  1-XXX-XXX-XXXX  or visit 
      www.XXXXXXXXXXXX.com  to                                                                                                             1031
      access your account.
                                                FIRSTNAME LASTNAME
                                                                                                              Check not valid after 9/9/12
                                                XXX STREET ADDRESS
                                                STATE XX  XXXXX-XXXX                                         DATE                             62-16
                                                                                                                                               311
                                                                                                              Offer ID XXXX-XXXXX
                                                PAY TO THE
                                                ORDER OF                      V      O       I    D                              $
                                                                                                                                          DOLLARS
                                                               XXXXXX Services, X.X.
                                                               XXXXXXXXX, XXXXXXXX
                                                FOR
   
   
                                                     A031100160A08770194992865C1031
   
   
                                                               Interest and  Fee  Information
   
         APR for Check Cash Advances                        0% Promotional APR through your statement Closing Date in May 2013.
   
         Promotional Offer ID XXXX-XXXXX                    When this Promotional APR ends, the APR for these promotional balances will
                                                            increase to a Check Cash Advance rate of 24.99%.  This APR will vary with
                                                            the market based on the U.S. Prime Rate.
   
         Use  by Date                                       You must use these checks by September 9, 2012 for the promotional APR to
                                                            apply.  Any of these checks used after that date will be declined.
   
         Fee                                                4% of the amount of each transaction (min. $10).
   
   
         Paying  Interest                                   Wewill  begin charging  interest on these  checks  on the transaction date.
       Your account was selected for the following promotional offer based on your account status as of June 20, 2012. §
   
       Promotional Offer ID XXXX-XXXXXX:   The Promotional Annual Percentage Rate (Promotional APR) is 0% (.000000% Daily Periodic Rate 
       ("DPR")).  This promotional offer applies to Balance Transfers, Direct Deposit Cash Advances and Check Cash Advances bearing this Offer ID 
       (each an "eligible transaction").  This offer applies to eligible transactions posting to your account beginning July 11, 2012 through September 9, 
       2012.  This Promotional APR ends on your statement Closing Date in May 2013.  When this Promotional APR ends, the APR for Balance Transfer 
       promotional balances will increase to a variable rate based on the U.S. Prime Rate; as of June 30, 2012, this APR is 20.99%.  When this 
       Promotional APR ends, the APR for Direct Deposit and Check Cash Advance promotional balances will increase to a variable rate based on the 
       U.S. Prime Rate; as of June 30, 2012, this APR is 24.99%.  Use of an attached check or draft will constitute a charge against your credit account. 
       The transaction date for each Check Cash Advance or Balance Transfer made by check is the date you or the person to whom the check is made 
       payable first deposits or cashes the check.  
   
       The transaction fee for Balance Transfers, Direct Deposit Cash Advances and Check Cash Advances is 4% of the U.S. dollar amount of each 
       transaction (min. $10).  
       Minimum Interest Charge $1.50. 
       If you revolve your balance to take advantage of this promotion, all transactions and balances, including purchases, will be charged interest.
   
       à §  See Disclosures on Reverse side. 
  **************************** Page 6 ****************************
Here are the sample Output formats i would like to see.....

For Payments and Other Credits
HTML Code:
Payments and Other Credits

Transaction   Posting                                             Reference   Account
   Date         Date     Description                                Number     Number     Amount       Total
                         
               06/18     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     2459        XXXX      - 247.10

               07/09     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     4383        XXXX      - 12.06
  07/09        07/10     PAYMENT - ELECTRONIC                       0050                  - 2,277.00
                                                                                                       - $2,536.16
For Purchases and Adjustments
HTML Code:
Purchases and Adjustments

Transaction   Posting                                             Reference   Account
   Date         Date     Description                                Number     Number     Amount       Total

  06/09        06/11     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     7683       XXXX       2.50        
  06/09        06/11     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     7907       XXXX       1.25
  06/09        06/11     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     6291       XXXX       21.28
  06/09        06/11     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     0917       XXXX       8.43
               ......................................
               ......................................
               ......................................
                                                                                                      $xxx.xx
For Fees

HTML Code:
Fees                                                          
                                                          
Transaction   Posting                                             Reference   Account                  
   Date         Date     Description                                Number     Number     Amount       Total      

  07/07        07/07     LATE FEE FOR PAYMENT DUE 07/07             3214                  22.00
  07/10        07/10     CREDIT PROTECTION PLUS XXX.XXX.XXXX        500P                  9.47   
                         TOTAL FEES FOR THIS PERIOD                                                    $31.47   
   
Interest Charged   
   
  07/10        07/10          Interest Charged on Purchases                               0.00   
  07/10        07/10          Interest Charged on Balance Transfers                       0.00   
  07/10        07/10          Interest Charged on Dir Dep&Chk CashAdv                     0.00   
  07/10        07/10          Interest Charged on Bank Cash Advances                      0.00   
                              TOTAL INTEREST FOR THIS PERIOD                                            $0.00   
   
For Year-to-Date
HTML Code:
2012 Totals Year-to-Date

Total fees charged in 2012           $122.93
Total interest charged in 2012       $0.00
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Advise on how to print range of lines above and below a number?

Hi, I have attached an output file which is some kind of database file mapping. It is basically like an allocation mapping of a tablespace and its datafile/s. The output is generated by the SQL script that I found from 401 Authorization Required Excerpts of the file are as below: ... (2 Replies)
Discussion started by: newbie_01
2 Replies

2. Shell Programming and Scripting

How to print N number of lines before and after the grep?

Hi , My record file , need to print up to above (DATA array)(there may be n no lines ) , grep "myvalue" row now .....suggest me some options --- DATA Array--- record type xxxxx sequence type yyyyy 2 3---> data1 /dev/ --- DEVICE --- MAXIMUM_People= data_blocks= MY_value=2 xyz abc ... (0 Replies)
Discussion started by: Huvan
0 Replies

3. Shell Programming and Scripting

Need to print the next word from the same line based on grep string condtion match.

I need to fetch particular string from log file based on grep condition match. Actual requirement is need to print the next word from the same line based on grep string condtion match. File :Java.lanag.xyz......File copied completed : abc.txt Ouput :abc.txt I have used below... (5 Replies)
Discussion started by: siva83
5 Replies

4. Shell Programming and Scripting

Match pattern and print the line number of occurence using awk

Hi, I have a simple problem but i guess stupid enough to figure it out. i have thousands rows of data. and i need to find match patterns of two columns and print the number of rows. for example: inputfile abd abp 123 abc abc 325 ndc ndc 451 mjk lkj... (3 Replies)
Discussion started by: redse171
3 Replies

5. Shell Programming and Scripting

awk print pattern match line and following lines

Data: Pattern Data Data Data Data Data Data Data Data Data ... With awk, how do I print the pattern matching line, then the subsequent lines following the pattern matching line. Varying number of lines following the pattern matching line. (9 Replies)
Discussion started by: dmesserly
9 Replies

6. Shell Programming and Scripting

Sed print range of lines between line number and pattern

Hi, I have a file as below This is the line one This is the line two <\XMLTAG> This is the line three This is the line four <\XMLTAG> Output of the SED command need to be as below. This is the line one This is the line two <\XMLTAG> Please do the need to needful to... (4 Replies)
Discussion started by: RMN
4 Replies

7. Shell Programming and Scripting

print range of lines matching pattern and previous line

Hi all, on Solaris 10, I'd like to print a range of lines starting at pattern but also including the very first line before pattern. the following doesn't print the range starting at pattern and going down to the end of file: cat <my file> | sed -n -e '/<pattern>{x;p;}/' I need to include the... (1 Reply)
Discussion started by: siriche
1 Replies

8. Shell Programming and Scripting

print lines between line number

Hi, Anyone help me to print the lines from the flat file between 879th line number and 1424th line number. The 879 and 1424 should be passed as input to the shell script(It should be dynamic). Can any one give me using sed or awk? I tried using read, and print the lines..Its taking too... (3 Replies)
Discussion started by: senthil_is
3 Replies

9. UNIX for Dummies Questions & Answers

grep N lines after match and then print them on 1 line each

Hello I have a silly question. I need to grep a match in text file and then print 5 lines after it. grep -A 5 .... do it. OK The next thing I can not handle is I need each output to be on 1 line match line2 line3 line4 line5 match line2 line3 line4 line5 etc.. I will really... (10 Replies)
Discussion started by: alekkz
10 Replies

10. Shell Programming and Scripting

grep N lines after match and then print them on 1 line each

Hello I need some help with this job. file.txt ----- cut ---- TARGET 13/11/08 20:43:21 POINT 1 MOVE 8 772102y64312417771 TARGET 13/11/08 21:10:01 POINT 2 MOVE 5 731623jjd12njhd ----- cut ---- this is the example. i need to grep for the word TARGET and print next 4 lines like... (1 Reply)
Discussion started by: alekkz
1 Replies
Login or Register to Ask a Question