Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Complex Output File String

Status
Not open for further replies.

mibeach7

MIS
Jun 18, 2003
35
US
I want to create one outfile in ASCII like the layout below, from one infile.

Write out Header record with rollup totals(from the detail), then write out detail record for all claims for that day for each person. The detail is Grouping by date and by person.

Do I need to use Collection Ojbect or Member Class to group the members and pointer for the detail???


Infile:
ron 25.00 11/01/2004
ron 25.00 11/01/2004
Ron 25.00 11/01/2004
Ron 25.00 11/02/2004
Jeff 25.00 11/01/2004
Jeff 25.00 11/01/2004

OUTFILE:
Header Ron 75.00 11/01/2004
Detail Ron 25.00 11/01/2004
Ron 25.00 11/01/2004
Ron 25.00 11/01/2004
Header Jeff 50.00 11/01/2004
Detail Jeff 25.00 11/01/2004
Jeff 25.00 11/01/2004
Header Ron 25.00 11/02/2004
Detail Ron 25.00 11/02/2004

Any ideas would be great, thanks..
 

One way would be to open the file in Excel, sort by date and name, use formulas to concatenate the name and the date (copy and paste special values), so that you end up with a two column table having name+date in one column and the amounts in the second column. Then use the Subtotals feature on that two column table to insert your "Header" totals. Finally delete the unnecessary columns and save as a .prn file.

-- gets you pretty darn close.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top