Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
PFA
I have below is a file format for CSv file
1~"Weekly Charts"~"Hotel Fundamentals"~"Industry Statistics"~"SA Real
Can you please suggest how should i load this.
Thanks
x:
LOAD
RowNo() as Unique,
[""Category""],
[""Subcategory""],
[""Dashboard""],
[""Chart""],
[""Line""],
[""Sr_No""",,,,,,]
FROM
(txt, codepage is 1252, embedded labels, delimiter is '~', no quotes, no eof);
do this
if delimiter is ~
LOAD
[Unique_No~],
Category,
Subcategory,
Dashboard,
Chart,
Line,
Sr_No
FROM
[..\2.csv]
(txt, codepage is 1252, embedded labels, delimiter is '"', msq);
if delimeter is ""
In the load script editor click on Table Files, select your file and follow the prompts.
Hi,
this should work:
LOAD
[Unique_No~],
Category,
Subcategory,
Dashboard,
Chart,
Line,
Sr_No
FROM
[..\2.csv]
(txt, codepage is 1252, embedded labels, delimiter is '"', msq);
Regards
Sebastian Lettner
x:
LOAD
RowNo() as Unique,
[""Category""],
[""Subcategory""],
[""Dashboard""],
[""Chart""],
[""Line""],
[""Sr_No""",,,,,,]
FROM
(txt, codepage is 1252, embedded labels, delimiter is '~', no quotes, no eof);
do this
if delimiter is ~
LOAD
[Unique_No~],
Category,
Subcategory,
Dashboard,
Chart,
Line,
Sr_No
FROM
[..\2.csv]
(txt, codepage is 1252, embedded labels, delimiter is '"', msq);
if delimeter is ""
Hi Deepak,
I really think that whoever creates your csv should change how they do it. If you're stuck with that format try this load script:
RawHeader:
First 1
LOAD
@1 &
@2 &
@3 &
@4 &
@5 &
@6 &
@7 as Header
FROM
[2.csv]
(txt, codepage is 1252, no labels, delimiter is ',', msq);
FieldNames:
Load
'@' & RowNo() as RawField,
*;
Load
SubField(PurgeChar(Header,'"'),'~') as Header
Resident RawHeader;
DROP Table RawHeader;
FieldNameMap:
Mapping
LOAD
* Resident FieldNames;
drop Table FieldNames;
Data:
LOAD
PurgeChar(@1, '"') as @1,
PurgeChar(@2, '"') as @2,
PurgeChar(@3, '"') as @3,
PurgeChar(@4, '"') as @4,
PurgeChar(@5, '"') as @5,
PurgeChar(@6, '"') as @6,
PurgeChar(PurgeChar(@7, '"'),',') as @7
FROM
[2.csv]
(txt, codepage is 1252, no labels, delimiter is '~', no quotes, filters(
Remove(Row, Pos(Top, 1))
));
RENAME Fields using 'FieldNameMap';
Hi Deepak,
You can load table like this,
Backend Script:
T:
LOAD
TextBetween(["Unique_No],'"','') as UniqueNo,
TextBetween([""Category""],'""','""') as Category,
TextBetween([""Subcategory""],'""','""') as SubCategory,
TextBetween([""Dashboard""],'""','""') as Dashboard,
TextBetween([""Chart""],'""','""') as Chart,
TextBetween([""Line""],'""','""') as Line,
TextBetween([""Sr_No""",,,,,,],'""','""",,,,,,') as Sr_No
FROM
[\2.csv]
(txt, codepage is 1252, embedded labels, delimiter is '~', no quotes, no eof);
Front-end:
PFA,
Hope this Helps,
Regards,
HirisH
Beautyful picture!))) Results?