View previous topic :: View next topic
|
Author |
Message |
kmanjunath Currently Banned New User
Joined: 27 Mar 2006 Posts: 3
|
|
|
|
Hi All,
I have an input file which has 100 rows with lenght 500.
Position 350 starts with Place ( Bangalore, Chennai, Pune, Mumbai)
I need to generate 2files out of my input file
The First file Should be just the copy of my input file and the second file should be a report.
The report should be having the following details
Header1
Header2
Date : Current Date
No of orders : 100
Details : Bangalore
Chennai
Pune
Mumbai
(IF Field(350:2) = 'BA' then move BANGALORE to report
IF Field(350:2) = 'CH' then move CHENNAI to report
same way with mumbai and pune.
I need to write the place name only once. Even if I have 10000 rows and if i have only 10 places in the files. I need to write only 10 rows (Place name) in the report.
Could you please suggest me how to do this.
I have done the coding. I am facing some problems. |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
keep a working storage table with fields Place and Counter. While reading the file increment the counters for each place and also create file 1 (same as input file).
At the end write report 2 to print the unique place with counter from the table. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
how about sorting the file? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I have done the coding. I am facing some problems. |
If you post the "problems" we may be able to help. We cannot guess at what is not working.
It will also help if you post some sample input data. |
|
Back to top |
|
|
|