Package - Variable Read from CSV+Email

More
2 years 5 months ago - 1 year 2 months ago #23538 by admin
The answer was already provided

www.etl-tools.com/forum/advanced-etl-pro...v-file.html?start=24

You can loop over lines with in the file using loop action (Loaded for the file option)

www.etl-tools.com/wiki/advanced-etl-proc...actions/loop-action/

The problem is that loop assigns data to a single variable per line. (<Loop Value>;)

In your case every line in the file contains multiple variables,
since you do no not want to load data into the database you have write a script which will split <Loop Value> into multiple variables

We will create an example for you

Mike
ETL Architect
Last edit: 1 year 2 months ago by admin.
The following user(s) said Thank You: prashant

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #23539 by admin
Here it is





var s: string;
    s1: string;
    s2: string;
    s3: string;
    i: Integer;
begin
  s:=GetVariable('<Loop Value>');
  i := Pos(',',s);
  if i>-1 then
   begin
    s1:=Copy(s,0,i-1);
    s:=Copy(s,i+1,1000);
   end;
   SetVariable('<Variable1>',s1);

  i := Pos(',',s);
  if i>-1 then
   begin
    s2:=Copy(s,0,i-1);
    s:=Copy(s,i+1,1000);
   end;
   SetVariable('<Variable2>',s2);
   SetVariable('<Variable3>',s);
   Result := true;
end ;

Mike
ETL Architect
The following user(s) said Thank You: prashant

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #23540 by admin
Please see attached file

Mike
ETL Architect
Attachments:
The following user(s) said Thank You: prashant

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago - 1 year 2 months ago #23567 by prashant
For Forum users reading this, Team ETl-tools have released a swanky new feature which makes this very simple

www.etl-tools.com/wiki/advanced-etl-proc...actions/loop-action/


See my rudimentary explanation to supplement . As you see I didn't use any special codes <> but everything works fine 
 
 
Last edit: 1 year 2 months ago by admin.

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save