Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to divide csv columns

Hello,

 

I have a csv file, where there "are" columns but its basicly everything in 1st column even when there are spaces between the needed columns.

What way can I divide the column into more than one and how do I set the conditions so it knows which part should be i next column.

 

Thanks for help

Labels (3)
3 Replies
akumar2301
Specialist II
Specialist II

can you please explain it with sample input and output

Anonymous
Not applicable
Author

I Input a csv file, where there is 1 row and 1 column (as in attachment) and output should be that these 5 potentional columns (vserver/volume/index/tree/Disk) are actually become 5 columns one in each with its infromation below (DISK - 5555).


example.png
TRF
Champion II
Champion II

tMap and String.split() are your friends for that:

0683p000009M3dO.png

Here is the result:

.---------------------------.
|      #1. tLogRow_12       |
+---------+-----------------+
| key     | value           |
+---------+-----------------+
| vserver | XXXXXX          |
| volume  | AAAAAAAAAAAAAAA |
| index   | BBBBBBBBBB      |
| tree    | DDDDDDDDDDDD    |
| disk    | 5555            |
+---------+-----------------+