Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
joegrant55
Contributor
Contributor

Store txt with header row

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

Labels (5)
13 Replies
joegrant55
Contributor
Contributor
Author

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?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

No you cant do that.

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
joegrant55
Contributor
Contributor
Author

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.

Brett_Bleess
Former Employee
Former Employee

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

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.