Combining multiple rows

How to combine multiple rows

Page 1 of 1

6 Replies - 1874 Views - Last Post: 28 October 2009 - 09:45 AM Rate Topic: -----

#1 svshastry  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 06-July 09

Combining multiple rows

Posted 21 July 2009 - 02:33 AM

I have a query regarding combining multiple rows, which I need to combine into 1 row.

I work in Income tax department and we generate various registers from a oracle database server... Many of them are in multiple rows.. An example is like this :-



DEMAND REGISTER


================================================================================================================
SL. NAME AY ASSESSED GROSS TAX PREPAID TAXES TOTAL TAX
NO. ADDRESS ACK NO. INCOME INTEREST TOTAL PREPAID
NET DEMAND
================================================================================================================
1 ABC 2007-08 1000000 100000 100000 125000
DEF ROAD 101 25000 100000
HIJ AVENUE 25000
INDIA


I would like to add the rows. I don't have access to the server data. Only report in *.lis / *.txt is available.

Just give me the idea to combine... I will try to code it

Is This A Good Question/Topic? 0
  • +

#3 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: Combining multiple rows

Posted 21 July 2009 - 03:20 AM

read the string line by line and append into a single string until you want then show it in a text box or write it into a file

sequential file handling in vb6 is in the tutorial section
Was This Post Helpful? 1
  • +
  • -

#4 svshastry  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 06-July 09

Re: Combining multiple rows

Posted 22 July 2009 - 11:02 AM

Thanks..

The file is paged like this 1-1, 1-2, 2-1, 2-2, 3-1....


REPORT ID : LRDNCR
Current Demand and Collection Register from 01-04-2008 to 30-03-2009
USERID : AO CODE : KRL C 12 1 Page : 1-1

REPORT ORDER : Order Date Wise CASES : Both Demand & Refund Cases
-----------------------------------------------------------------------------------------------------------------------------------
S.No. Bundle No. Acknowledgement No.
PAN Asst Yr D&CR No Stat Total Income Demand/ Interest Payable Gross Demand Pre-Paid Tax Tax Crdt 115JAA
Name Section Order Dt. Penalty By Assessee Collections Tax 115-O/115P
Address Sect Amount (3) Refunds Net Demand
State - pin (1) (2) (1) + (2) (4) (5)
-----------------------------------------------------------------------------------------------------------------------------------
1 0 61 12469981080208
ABCDE1234D 2007-08 001 000 12 -19046940 93607756 234A 0
ABCD CORPORATION 01-04-08 234B 0 93607756 240636685 0
LIMITED 143 (1) 234C 0 0 0
603 0 -147028929
RANI SEETHA ENCLAVE Total 0
Total 240636685
MUMBAI
MAHARASHTRA-
......

Page 2
Date : 30-03-09
Page : 1-2



------------------------------------------------------------------------------------------------------------------------------------

Int u/s 244A Int u/s 234D Int. u/s 220 Tot Net Pybl Refund Coll/Encash of Refund |------- Interest u/s 220-------| +/- in Demand
Pmt u/s 244A Pmt u/s 234D Coll u/s 220 Serv Date Vou. No Amount Date Demand Cr Mth Collect. Amt wrt Last Order
Bal u/s 244A Bal u/s 234D Bal u/s 220 Due Date Date D&CR No Serv. Dt Date Last Order Dt
(6) (7) (8) (5-6+7+8) D&CR No
------------------------------------------------------------------------------------------------------------------------------------

-153645229
6616300 0 0 06-04-08 178939
0 0 0 06-05-08 178935
6616300 0 0

Refund Released

-----

These two pages are to be merged into a single dbf which will be used for mail merging for letters for high demand, high refund, high prepaid taxes etc..

I will post the my code in 2 days.. ( It will take atleast taht much days for me to code in trial and error )
in the menatime you try to solve it and compare with mine.

Thanks
Was This Post Helpful? 0
  • +
  • -

#6 Quin  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 19
  • View blog
  • Posts: 382
  • Joined: 16-October 08

Re: Combining multiple rows

Posted 22 July 2009 - 12:03 PM

Just another suggestion, which is along similar lines (unless it is the same line).

Read into a variable, looping, and just add the new data.

'start loop
LOOP

'clear the variables of data
Var1 = ""
Var2 = ""

'read from file
Read Line1
'load first line into first variable
Var1 = Line1

'add the first line/variable to the second (running total) variable
Var2 = Var2 + Var1

'loop until end of file
LOOP Until (EOF(1))


With that:
1
2
3
4
5
Will become
Var2 = 12345

You can separate with a tab (using ASCII)

Or you could use an array to store every single line (though that requires more time/effort/space).

This post has been edited by Quin: 23 July 2009 - 11:53 AM

Was This Post Helpful? 1
  • +
  • -

#7 svshastry  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 06-July 09

Re: Combining multiple rows

Posted 02 August 2009 - 01:25 AM

Thanks..

How can i made the search for one page at a time and joining the lines between the "------" and the next "------"?
Was This Post Helpful? 0
  • +
  • -

#8 Quin  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 19
  • View blog
  • Posts: 382
  • Joined: 16-October 08

Re: Combining multiple rows

Posted 03 August 2009 - 08:50 AM

Sorry, I don't understand what you mean.
Was This Post Helpful? 0
  • +
  • -

#9 svshastry  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 06-July 09

Re: Combining multiple rows

Posted 28 October 2009 - 09:45 AM

namaste to all,

I am sorry for the delay in reply. I had an accident and was on rest for two months.

My question is

How to add the lines of the following text file and convert it into a dbf.

The report is generated from a Oracle server in lis format.

The report has entries to the length of two pages..

This will be the first page numbered 1-1

"REPORT ID : LRDNCR
Current Demand and Collection Register from 01-04-2008 to 30-03-2009
USERID : AO CODE : KRL C 12 1 Page : 1-1

REPORT ORDER : Order Date Wise CASES : Both Demand & Refund Cases
-----------------------------------------------------------------------------------------------------------------------------------
S.No. Bundle No. Acknowledgement No.
PAN Asst Yr D&CR No Stat Total Income Demand/ Interest Payable Gross Demand Pre-Paid Tax Tax Crdt 115JAA
Name Section Order Dt. Penalty By Assessee Collections Tax 115-O/115P
Address Sect Amount (3) Refunds Net Demand
State - pin (1) (2) (1) + (2) (4) (5)
-----------------------------------------------------------------------------------------------------------------------------------
1 0 61 12469981080208
ABCDE1234D 2007-08 001 000 12 -19046940 93607756 234A 0
ABCD CORPORATION 01-04-08 234B 0 93607756 240636685 0
LIMITED 143 (1) 234C 0 0 0
603 0 -147028929
RANI SEETHA ENCLAVE Total 0
Total 240636685
MUMBAI
MAHARASHTRA-
......"


and its corresponding entry in the facing page will be

Page 2
Date : 30-03-09
Page : 1-2



------------------------------------------------------------------------------------------------------------------------------------

Int u/s 244A Int u/s 234D Int. u/s 220 Tot Net Pybl Refund Coll/Encash of Refund |------- Interest u/s 220-------| +/- in Demand
Pmt u/s 244A Pmt u/s 234D Coll u/s 220 Serv Date Vou. No Amount Date Demand Cr Mth Collect. Amt wrt Last Order
Bal u/s 244A Bal u/s 234D Bal u/s 220 Due Date Date D&CR No Serv. Dt Date Last Order Dt
(6) (7) (8) (5-6+7+8) D&CR No
------------------------------------------------------------------------------------------------------------------------------------

-153645229
6616300 0 0 06-04-08 178939
0 0 0 06-05-08 178935
6616300 0 0

Refund Released

-----


EAch page of 132 column printed in a fanfold (15x12 cm) and bound together like 1-1 facing 1-2. Each page -1 will have 6 records maximum and its details on page -2.

each record is separated by "---------------------------------------".

Hope the above is cleared
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1