Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to change the delimited file.

Hi i have a one log file.This is a unstructured format.how to arrange this type of file in qlikview.Please help me.

7 Replies
Sokkorn
Master
Master

Hi Mani,

Can you attached your log file?

Regards,

Sokkorn

Not applicable
Author

HI Sokkorn

Hi have attached a log file.

02145 12.02.13 EmpID:02365, DepID:3265, SalID:32365

02145 12.02.13 Status_comm: Proessing Succeded for 02145

02149 12.02.13 EmpID:02366, DepID:3268, SalID:32366

02149 12.02.13 Status_comm: Proessing Succeded for 02149

02150 12.02.13 EmpID:02367, DepID:3269, SalID:32369

02150 12.02.13 Status_comm: Proessing Succeded for 02150

i try to use fixed Record option.i can't able this process.

Not applicable
Author

Have a look at DocLog Analyzer created by Rob at robwunderlich.com/downloads/

Not applicable
Author

Hi Angad,

I download this qvw file.but the Data source is not loaded.what i do.

Sokkorn
Master
Master

Hi Mani,

Let try this

[LogFile]:

LOAD

  @1:14 AS [tmpField1],

  @15:n AS [tmpField2]

FROM [Log.log]

(fix, codepage is 1252);

[Table1]:

LOAD

  [tmpField1] AS _Key,

  [tmpField2] AS Field1

Resident [LogFile] Where WildMatch(tmpField2,'*EmpID*');

Join (Table1)

LOAD

  [tmpField1] AS _Key,

  [tmpField2] AS Field2

Resident [LogFile] Where WildMatch(tmpField2,'*Status_comm*');

[Table2]:

LOAD

  _Key,

  Trim(SubField(FieldN,':',1)) AS FieldName,

  Trim(SubField(FieldN,':',2)) AS FieldVal;

LOAD

  _Key,

  Trim(SubField(NewField,',')) As FieldN

  ;

LOAD

  _Key,

  //SubField(_Key,' ',1) AS RecID,

  //Date(Date#(SubField(_Key,' ',2),'dd.MM.yy')) AS Dates,

  Field1 & ', ' & Field2 AS NewField

Resident [Table1];

DROP Table [Table1];

[TMP1]:

Generic LOAD * Resident [Table2];

[tmpResult]:

LOAD Distinct _Key Resident [Table2];

DROP Table [Table2];

FOR i = 0 to NoOfTables()

TableList:

LOAD TableName($(i)) AS Tablename AutoGenerate 1

Where WildMatch(TableName($(i)), 'TMP1.*');

NEXT i

FOR i = 1 to FieldValueCount('Tablename')

LET vTable = FieldValue('Tablename', $(i));

Left Join ([tmpResult]) LOAD * Resident $(vTable);

DROP Table $(vTable);

NEXT i

DROP Table TableList;

[Result]:

LOAD

  SubField(_Key,' ',1) AS RecID,

  Date(Date#(SubField(_Key,' ',2),'dd.MM.yy')) AS Dates,

  *

Resident [tmpResult];

DROP Table [tmpResult];

DROP Field [_Key];

See sample attached file also.

Regards,

Sokkorn

Not applicable
Author

Which Data Source you are talking about. You just need to give the path of the directory where you have the logs.

Not applicable
Author

Thanks Sokkorn,now its working.but i have one more file, like

02145 12.02.13 EmpID:02365, DepID:3265,

02145 12.02.13 EmpID:02345, DepID:3265,

02145 12.02.13 Status_comm: Proessing Succeded.

02145 12.02.13 EmpID:02346, DepID:3265,

02145 12.02.13 EmpID:02347, DepID:3265,

02149 12.02.13 EmpID:02366, DepID:3265,

02149 12.02.13 Act: Processing Succeded.

02149 12.02.13 Act: to 123456789

02145 12.02.13 EmpID:02366, DepID:3266,

02145 12.02.13 EmpID:02346, DepID:3266,

02145 12.02.13 Status_comm: Proessing Succeded.

02145 12.02.13 EmpID:02347, DepID:3266,

02149 12.02.13 EmpID:02367, DepID:3266,

02149 12.02.13 Act: Processing Succeded.

02149 12.02.13 Act: to 123456780

In this my log file, so i want to be extract only DepId and EmpId only to report. Please give how to separate DepId and EmpId.