Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have created a table that stores multiple fields into a txt file.
I need to add a 'header row' above the current fields as this txt file is loaded into a system that uses the header row as an indication of what to do with the file. My delimiter is '|'.
Example:
Header1|Header2|Header3|Header4
Field1|Field2|Field3|Field4|Field5|Field6|Field7|Field8|Field9|Field10
Does anyone know how I add a header row in the script?
Thanks,
Joe
Thanks this seems to work apart from 1 problem.
I have renamed @1, @2, @3 and @4 to the required header names.
I am now left with @5 to @37 which I don't need. Ideally I need the data in these fields but not the field names. Is there any solution for this issue?
Hi,
No you cant do that.
Okay, are there any other solutions to my problem? This is part of a daily process which I am automating and this is the only step I have been unable to automate using Qlik.
Joe, what about using PowerShell script in Windows to modify the CSV file after you create it to add the headers that way? You can even call that script from our load script if you allow Execute in the Script Editor for that app, or if you have Publisher, you could create an External Task in Supporting Tasks to launch things after that reload etc... That is likely going to be the best way I think, as I suspect PowerShell should likely be easier to use to do the insert of that into the file than trying to do things via our script. Hopefully this may work.
Cheers,
Brett