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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need c++ code to convert a file into another format. (URGENT)

Status
Not open for further replies.

ab1966

Programmer
Jul 3, 2001
6
0
0
US
Hi C Gurus, Its been long time since I programmed in C. I almost forgot everything. Please help me writing the code. Here is what I need. I have a file with the following format :

Title Col1 Col2 Col3 Col4
Row1 X X
Row2 X X X
Row3 X X X

This is a comma delimited file. Now I want to convert it into another format as follows :
Col1, Row2
Col1, Row3
Col2, Row1
Col2, Row3
Col3, Row2
Col4, Row1
Col4, Row2
COl4, Row3

Please help me. Thanks in advance. FYI. I am using C++ on AIX.

Ab




 
Well... if you can send me the file... it looks like i could write up a parser for you in about 20 minutes (judging from the format) Just put all the details into the email

matt

Zyrenthian@home.com
 
Here is a sample of the file :

"Screens", "Customer Service Rep", "Sales Rep", "CRM Admin"
"All Opp View","X",,"X"
"Admin View","X",,"X"
"Employee View",,,"X"

and here is what I need :

"Customer Service Rep","All Opp View"
"Customer Service Rep","Admin View"
"CRM Admin","All Opp View"
"CRM Admin","Admin View"
"CRM Admin","Employee View"

Notice in the output "Sales Rep" doesn't exist because in the input file there is no X mark that column. For better view you can create the file and open it in MS-Excel. I hope this make sense.

Please send the code to me at abhattac@netzero.net.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top