Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
hectorgarcia
Partner - Creator III
Partner - Creator III

tricky text file transformation

I need to analize a a logfile in txt fromat.

a single record is normally received in one line but in many cases a record information is in several lines (much times up to 500 times)

What I need is to have in a single line all the children lines that have more than 1 line per record.

For security reasons i cannot upload the file but i'm attaching the conceptual struture of the logfile.

This is my current challenge, once i solve this i will easily read and extract any information on each record using string scripting techniques (subfiled, match etc)

any help will be greatly appreciated.

error loading image

hector

1 Solution

Accepted Solutions
Not applicable

If we treat finding </GLTData> as the end of line segments to be constructed, the attached file will work. Take a look.

Tom

View solution in original post

5 Replies
prieper
Master II
Master II

Which is the identifyer and which data do you need to extract?

hectorgarcia
Partner - Creator III
Partner - Creator III
Author

Hi peter, I'm not worried about the data itself since i'm very clear about the scripting techniques to extract data from flat files or any other non conventional datasource using string functions...the challenge i'm having for now is how to manipulate with qilkview a file that is comming with the structure I described.

Currently what i'm doing is to manipulate the file with a textpad macro that performs 2 tasks:

1) Find every new line indicator (\n) and replace it by a white space (this convert the entire file in a single line.....)

2) Then Find and replace the regular expression </GLTData> for </GLTData>\n

The problem is that this is a very manual procedure and the files size are too big and are many files to process so it is very "expensive" to do that

I want to use the qlikview power to perform this transformation with some scripting techniques since the wizard is not helping me to obtain the same result WITH NO EXTRA MANIPULATION OF THE DATA

Please find attached a ppt that will show the current problem and how the workaround applied is making the "expensive' trick

Not applicable

If we treat finding </GLTData> as the end of line segments to be constructed, the attached file will work. Take a look.

Tom

prieper
Master II
Master II

Clever idea to examine for the end of line.

Peter

hectorgarcia
Partner - Creator III
Partner - Creator III
Author

THANKS TOM, VERY CREATIVE, CONGRATULATIONS, NOW I'M ABLE TO CONTINUE WITH MY TRANSFORMATION WITH NO PROBLEMS, TANKS A LOT!!!!!!!!!

HECTOR