Change Columns to Rows

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

khurram
Posts: 1
Joined: Sun Feb 20, 2005 3:12 pm

Change Columns to Rows

Postby khurram » Sun Feb 20, 2005 3:23 pm

Hi,

I have a huge file in the following format:

------------------------ RECORD No. 1 -----------------------------------
Application Manager Id : 20
CDR Data Block Length : 548
Cdr version major/minor : 3 / 5
Cdr record type : 1 / (1=Voice, 2=Audit, 3=AtmPvc, 4=AtmSvc)
Cdr Category type : 0 / (0=Normal, 1=Usage Sensitive)
cdrTotalPage / cdrPage : 1 / 1
Call_ID / smInstance : 0x10586cc / 2920
Orig Incoming Signals : SETUP, RELCOMP, (101)



------------------------- RECORD No. 2 -----------------------------------
Application Manager Id : 20
CDR Data Block Length : 548
Cdr version major/minor : 3 / 5
Cdr record type : 1 / (1=Voice, 2=Audit, 3=AtmPvc, 4=AtmSvc)
Cdr Category type : 0 / (0=Normal, 1=Usage Sensitive)
cdrTotalPage / cdrPage : 1 / 1
Call_ID / smInstance : 0x1058716 / 6424
Orig Incoming Signals : SETUP, RELEASE, (81)

The problem is that each record comes out as rows and not in columns. Each record also contains close to 140 fields. At the end of each record, there are three blank lines before a new record starts. To be able to move the data into a database, I need to change the rows into columns. Ultimately, I would like the data to formatted with quotes surrounding each field and seperate by commas, shown as follows. The column headers can be eliminated as well.

"20","548","3 / 5","1 / (1=Voice, 2=Audit, 3=AtmPvc, 4=AtmSvc)","0 / (0=Normal, 1=Usage Sensitive)","1 / 1","0x10586cc / 2920","SETUP, RELCOMP, (101)"
"20","548","3 / 5","1 / (1=Voice, 2=Audit, 3=AtmPvc, 4=AtmSvc)","0 / (0=Normal, 1=Usage Sensitive)","1 / 1","0x1058716 / 6424","SETUP, RELEASE, (81)"

Any suggestions would be greatly appreciated. Thanks.
Khurram

User avatar
DataMystic Support
Site Admin
Posts: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Postby DataMystic Support » Thu Feb 24, 2005 8:44 am

Replied via email already - we can set this up for you.

You need to handle this 35 fields at a time. Just use EasyPattern Helper to highlight which fields are variable, and then paste those patterns into TextPipe.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Baidu [Spider], Yahoo [Bot] and 5 guests