Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a simple question but could not find the answer yet.
I have multiple files of data without header that I need to process. I have a list of header that can identify each column for these files.
Also, not all of the columns will be used when loading the data, so it will be partial load too.
What is the best way to do this?
The question is actually while the columns can be named easily, is it possible to manipulate the newly defined column names with some operations, such as left(newly defined column, 3), Date (newly defined column name) etc?
When I did this and load the data the script did not recognize this field so I had to use the column number instead of new field name.
Can you please share some sample data and the desired output so that we can take a look,
This is the example of the script I use:
LOAD @1 as Date, @2 as [ Time],
@3 as [ IP address],
@4 as Field D, @5 as Field E,
@6 as Field F, @7 as Field G,
Date (Date, 'DD/MM/YYY')&' '& @2 as [Time Stamp],
Left(Filed G,5) as Hardware_Type
FROM
File Source;
Where Time Stamp >'26/05/2016';
The above script did not work unless I change
Date (Date, 'DD/MM/YYY')&' '& @2 as [Time Stamp],
Left(Filed G,5) as Hardware_Type
to
Date (@1, 'DD/MM/YYY')&' '& @2 as [Time Stamp],
Left(@7,5) as Hardware_Type
and also Where Time Stamp >'26/05/2016'; to Where T@1 >'26/05/2016';