Talend get current filename
up vote
0
down vote
favorite
I want to load excel files into the mysql database and check that they do not already exist, my problem is that I can not extract the name of the current file.
For example, I have the following files A.xlsx
, B.xlsx
and C.xls
.
It return always B.xlsx
filenames talend
add a comment |
up vote
0
down vote
favorite
I want to load excel files into the mysql database and check that they do not already exist, my problem is that I can not extract the name of the current file.
For example, I have the following files A.xlsx
, B.xlsx
and C.xls
.
It return always B.xlsx
filenames talend
Welcome @huda_tt. Can you try to give a bit more detail about what is happening? Could you include examples? When you say "it always returns" can you say what "it" is? Where are you trying to get the filename from? In which component?
– Screwtape
Nov 20 at 9:30
hi @Screwtape I want to extract the current filename first in the "tdatabaseinput" to make the query {"SELECTprocessedfile
.NOM
FROMprocessedfile
WHERE NAME = '" + ((String) globalMap.get ("tFileList_1_CURRENT_FILE")) + "'" } if it does not already exist I want to insert it (current file name) in the mysqltable "prossedfile" using "tfixedflowinput" but the value inserted is always the same ~$B.xlsx
– huda tt
Nov 20 at 9:56
The link between tFileLink_1 and tFixedFlowInput_1 is not iterating - it will only pick up the (first/last?) iteration. Try running your subjob from a "run if" from the "disponibilite_3g" component, or even the map component.
– Screwtape
Nov 20 at 10:20
ok @Screwtape i try to do this job to extract current filename and identifie the probleme [enter image description here][1] but i still have the name of latest file [enter image description here][2] [enter image description here][3] [enter image description here][4] [1]: i.stack.imgur.com/FFjk3.png [2]: i.stack.imgur.com/Ia6RW.png [3]: i.stack.imgur.com/wi3bW.png [4]: i.stack.imgur.com/ETqOu.png
– huda tt
Nov 20 at 12:44
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to load excel files into the mysql database and check that they do not already exist, my problem is that I can not extract the name of the current file.
For example, I have the following files A.xlsx
, B.xlsx
and C.xls
.
It return always B.xlsx
filenames talend
I want to load excel files into the mysql database and check that they do not already exist, my problem is that I can not extract the name of the current file.
For example, I have the following files A.xlsx
, B.xlsx
and C.xls
.
It return always B.xlsx
filenames talend
filenames talend
edited Nov 20 at 2:35
RealHowTo
27.3k86075
27.3k86075
asked Nov 19 at 22:56
huda tt
1
1
Welcome @huda_tt. Can you try to give a bit more detail about what is happening? Could you include examples? When you say "it always returns" can you say what "it" is? Where are you trying to get the filename from? In which component?
– Screwtape
Nov 20 at 9:30
hi @Screwtape I want to extract the current filename first in the "tdatabaseinput" to make the query {"SELECTprocessedfile
.NOM
FROMprocessedfile
WHERE NAME = '" + ((String) globalMap.get ("tFileList_1_CURRENT_FILE")) + "'" } if it does not already exist I want to insert it (current file name) in the mysqltable "prossedfile" using "tfixedflowinput" but the value inserted is always the same ~$B.xlsx
– huda tt
Nov 20 at 9:56
The link between tFileLink_1 and tFixedFlowInput_1 is not iterating - it will only pick up the (first/last?) iteration. Try running your subjob from a "run if" from the "disponibilite_3g" component, or even the map component.
– Screwtape
Nov 20 at 10:20
ok @Screwtape i try to do this job to extract current filename and identifie the probleme [enter image description here][1] but i still have the name of latest file [enter image description here][2] [enter image description here][3] [enter image description here][4] [1]: i.stack.imgur.com/FFjk3.png [2]: i.stack.imgur.com/Ia6RW.png [3]: i.stack.imgur.com/wi3bW.png [4]: i.stack.imgur.com/ETqOu.png
– huda tt
Nov 20 at 12:44
add a comment |
Welcome @huda_tt. Can you try to give a bit more detail about what is happening? Could you include examples? When you say "it always returns" can you say what "it" is? Where are you trying to get the filename from? In which component?
– Screwtape
Nov 20 at 9:30
hi @Screwtape I want to extract the current filename first in the "tdatabaseinput" to make the query {"SELECTprocessedfile
.NOM
FROMprocessedfile
WHERE NAME = '" + ((String) globalMap.get ("tFileList_1_CURRENT_FILE")) + "'" } if it does not already exist I want to insert it (current file name) in the mysqltable "prossedfile" using "tfixedflowinput" but the value inserted is always the same ~$B.xlsx
– huda tt
Nov 20 at 9:56
The link between tFileLink_1 and tFixedFlowInput_1 is not iterating - it will only pick up the (first/last?) iteration. Try running your subjob from a "run if" from the "disponibilite_3g" component, or even the map component.
– Screwtape
Nov 20 at 10:20
ok @Screwtape i try to do this job to extract current filename and identifie the probleme [enter image description here][1] but i still have the name of latest file [enter image description here][2] [enter image description here][3] [enter image description here][4] [1]: i.stack.imgur.com/FFjk3.png [2]: i.stack.imgur.com/Ia6RW.png [3]: i.stack.imgur.com/wi3bW.png [4]: i.stack.imgur.com/ETqOu.png
– huda tt
Nov 20 at 12:44
Welcome @huda_tt. Can you try to give a bit more detail about what is happening? Could you include examples? When you say "it always returns" can you say what "it" is? Where are you trying to get the filename from? In which component?
– Screwtape
Nov 20 at 9:30
Welcome @huda_tt. Can you try to give a bit more detail about what is happening? Could you include examples? When you say "it always returns" can you say what "it" is? Where are you trying to get the filename from? In which component?
– Screwtape
Nov 20 at 9:30
hi @Screwtape I want to extract the current filename first in the "tdatabaseinput" to make the query {"SELECT
processedfile
.NOM
FROM processedfile
WHERE NAME = '" + ((String) globalMap.get ("tFileList_1_CURRENT_FILE")) + "'" } if it does not already exist I want to insert it (current file name) in the mysqltable "prossedfile" using "tfixedflowinput" but the value inserted is always the same ~$B.xlsx– huda tt
Nov 20 at 9:56
hi @Screwtape I want to extract the current filename first in the "tdatabaseinput" to make the query {"SELECT
processedfile
.NOM
FROM processedfile
WHERE NAME = '" + ((String) globalMap.get ("tFileList_1_CURRENT_FILE")) + "'" } if it does not already exist I want to insert it (current file name) in the mysqltable "prossedfile" using "tfixedflowinput" but the value inserted is always the same ~$B.xlsx– huda tt
Nov 20 at 9:56
The link between tFileLink_1 and tFixedFlowInput_1 is not iterating - it will only pick up the (first/last?) iteration. Try running your subjob from a "run if" from the "disponibilite_3g" component, or even the map component.
– Screwtape
Nov 20 at 10:20
The link between tFileLink_1 and tFixedFlowInput_1 is not iterating - it will only pick up the (first/last?) iteration. Try running your subjob from a "run if" from the "disponibilite_3g" component, or even the map component.
– Screwtape
Nov 20 at 10:20
ok @Screwtape i try to do this job to extract current filename and identifie the probleme [enter image description here][1] but i still have the name of latest file [enter image description here][2] [enter image description here][3] [enter image description here][4] [1]: i.stack.imgur.com/FFjk3.png [2]: i.stack.imgur.com/Ia6RW.png [3]: i.stack.imgur.com/wi3bW.png [4]: i.stack.imgur.com/ETqOu.png
– huda tt
Nov 20 at 12:44
ok @Screwtape i try to do this job to extract current filename and identifie the probleme [enter image description here][1] but i still have the name of latest file [enter image description here][2] [enter image description here][3] [enter image description here][4] [1]: i.stack.imgur.com/FFjk3.png [2]: i.stack.imgur.com/Ia6RW.png [3]: i.stack.imgur.com/wi3bW.png [4]: i.stack.imgur.com/ETqOu.png
– huda tt
Nov 20 at 12:44
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
enter image description here
thank you @Screwtape I link your second subjob from the disponsibilite_3G component
but i have the following error
New contributor
Hi! The way in which we would normally use Stack Overflow would be that this post would have been a comment on my answer, rather than another answer. I can't see what has caused your null-pointer exception without seeing a lot of detail from your project. Can you show a picture of your project as you have it now, and I'll see if I can guess where the issue is.
– Screwtape
Nov 20 at 16:06
add a comment |
up vote
0
down vote
I think the issue you have is that your "RunIf" link is before the iterator, and therefore it's not being triggered at the right time.
The image below shows a simplified version, where I list the rows in the spreadsheets and then the file names. If I connected the second subjob to the tFileList_1
component, as you did in the question, I only get the logs from tLogRow_1
and the last filename by tLogRow_2
.
With the link as shown, behind the iterator, then I get spreadsheet contents listed and then the title of it:
Col1|Col2|Col3
A|B|C
D|E|F
A.xlsx
Col1|Col2|Col3
A|B|C
D|E|F
B.xlsx
Col1|Col2|Col3
A|B|C
D|E|F
C.xlsx
I am assuming that you have filted out the duplicated files in the tMap
component, so if you link your second subjob from the disponsibilite_3d
component, I think you will get the result you are looking for.
thank you @Screwtape but witch i want is to get only the name of file used in the job (disponibilite_3G in this case ) to save it into a table mysql and not names of all directory files any help please
– huda tt
Nov 21 at 13:59
Does your tMap filter the files that aren’t used, so that it only gets to the database update when the file hasn’t already been used?
– Screwtape
Nov 21 at 14:02
yes that's which i want , this filter in the tfilelist i don't know how i can do it , sorry but i am beginner in talend
– huda tt
Nov 21 at 14:06
I try to select the file names of the DB table with tmysqlinput and then compare the value with the current file name to check if it does not exist already does not exist already
– huda tt
Nov 21 at 14:13
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
enter image description here
thank you @Screwtape I link your second subjob from the disponsibilite_3G component
but i have the following error
New contributor
Hi! The way in which we would normally use Stack Overflow would be that this post would have been a comment on my answer, rather than another answer. I can't see what has caused your null-pointer exception without seeing a lot of detail from your project. Can you show a picture of your project as you have it now, and I'll see if I can guess where the issue is.
– Screwtape
Nov 20 at 16:06
add a comment |
up vote
0
down vote
enter image description here
thank you @Screwtape I link your second subjob from the disponsibilite_3G component
but i have the following error
New contributor
Hi! The way in which we would normally use Stack Overflow would be that this post would have been a comment on my answer, rather than another answer. I can't see what has caused your null-pointer exception without seeing a lot of detail from your project. Can you show a picture of your project as you have it now, and I'll see if I can guess where the issue is.
– Screwtape
Nov 20 at 16:06
add a comment |
up vote
0
down vote
up vote
0
down vote
enter image description here
thank you @Screwtape I link your second subjob from the disponsibilite_3G component
but i have the following error
New contributor
enter image description here
thank you @Screwtape I link your second subjob from the disponsibilite_3G component
but i have the following error
New contributor
New contributor
answered Nov 20 at 14:12
huda tt
1
1
New contributor
New contributor
Hi! The way in which we would normally use Stack Overflow would be that this post would have been a comment on my answer, rather than another answer. I can't see what has caused your null-pointer exception without seeing a lot of detail from your project. Can you show a picture of your project as you have it now, and I'll see if I can guess where the issue is.
– Screwtape
Nov 20 at 16:06
add a comment |
Hi! The way in which we would normally use Stack Overflow would be that this post would have been a comment on my answer, rather than another answer. I can't see what has caused your null-pointer exception without seeing a lot of detail from your project. Can you show a picture of your project as you have it now, and I'll see if I can guess where the issue is.
– Screwtape
Nov 20 at 16:06
Hi! The way in which we would normally use Stack Overflow would be that this post would have been a comment on my answer, rather than another answer. I can't see what has caused your null-pointer exception without seeing a lot of detail from your project. Can you show a picture of your project as you have it now, and I'll see if I can guess where the issue is.
– Screwtape
Nov 20 at 16:06
Hi! The way in which we would normally use Stack Overflow would be that this post would have been a comment on my answer, rather than another answer. I can't see what has caused your null-pointer exception without seeing a lot of detail from your project. Can you show a picture of your project as you have it now, and I'll see if I can guess where the issue is.
– Screwtape
Nov 20 at 16:06
add a comment |
up vote
0
down vote
I think the issue you have is that your "RunIf" link is before the iterator, and therefore it's not being triggered at the right time.
The image below shows a simplified version, where I list the rows in the spreadsheets and then the file names. If I connected the second subjob to the tFileList_1
component, as you did in the question, I only get the logs from tLogRow_1
and the last filename by tLogRow_2
.
With the link as shown, behind the iterator, then I get spreadsheet contents listed and then the title of it:
Col1|Col2|Col3
A|B|C
D|E|F
A.xlsx
Col1|Col2|Col3
A|B|C
D|E|F
B.xlsx
Col1|Col2|Col3
A|B|C
D|E|F
C.xlsx
I am assuming that you have filted out the duplicated files in the tMap
component, so if you link your second subjob from the disponsibilite_3d
component, I think you will get the result you are looking for.
thank you @Screwtape but witch i want is to get only the name of file used in the job (disponibilite_3G in this case ) to save it into a table mysql and not names of all directory files any help please
– huda tt
Nov 21 at 13:59
Does your tMap filter the files that aren’t used, so that it only gets to the database update when the file hasn’t already been used?
– Screwtape
Nov 21 at 14:02
yes that's which i want , this filter in the tfilelist i don't know how i can do it , sorry but i am beginner in talend
– huda tt
Nov 21 at 14:06
I try to select the file names of the DB table with tmysqlinput and then compare the value with the current file name to check if it does not exist already does not exist already
– huda tt
Nov 21 at 14:13
add a comment |
up vote
0
down vote
I think the issue you have is that your "RunIf" link is before the iterator, and therefore it's not being triggered at the right time.
The image below shows a simplified version, where I list the rows in the spreadsheets and then the file names. If I connected the second subjob to the tFileList_1
component, as you did in the question, I only get the logs from tLogRow_1
and the last filename by tLogRow_2
.
With the link as shown, behind the iterator, then I get spreadsheet contents listed and then the title of it:
Col1|Col2|Col3
A|B|C
D|E|F
A.xlsx
Col1|Col2|Col3
A|B|C
D|E|F
B.xlsx
Col1|Col2|Col3
A|B|C
D|E|F
C.xlsx
I am assuming that you have filted out the duplicated files in the tMap
component, so if you link your second subjob from the disponsibilite_3d
component, I think you will get the result you are looking for.
thank you @Screwtape but witch i want is to get only the name of file used in the job (disponibilite_3G in this case ) to save it into a table mysql and not names of all directory files any help please
– huda tt
Nov 21 at 13:59
Does your tMap filter the files that aren’t used, so that it only gets to the database update when the file hasn’t already been used?
– Screwtape
Nov 21 at 14:02
yes that's which i want , this filter in the tfilelist i don't know how i can do it , sorry but i am beginner in talend
– huda tt
Nov 21 at 14:06
I try to select the file names of the DB table with tmysqlinput and then compare the value with the current file name to check if it does not exist already does not exist already
– huda tt
Nov 21 at 14:13
add a comment |
up vote
0
down vote
up vote
0
down vote
I think the issue you have is that your "RunIf" link is before the iterator, and therefore it's not being triggered at the right time.
The image below shows a simplified version, where I list the rows in the spreadsheets and then the file names. If I connected the second subjob to the tFileList_1
component, as you did in the question, I only get the logs from tLogRow_1
and the last filename by tLogRow_2
.
With the link as shown, behind the iterator, then I get spreadsheet contents listed and then the title of it:
Col1|Col2|Col3
A|B|C
D|E|F
A.xlsx
Col1|Col2|Col3
A|B|C
D|E|F
B.xlsx
Col1|Col2|Col3
A|B|C
D|E|F
C.xlsx
I am assuming that you have filted out the duplicated files in the tMap
component, so if you link your second subjob from the disponsibilite_3d
component, I think you will get the result you are looking for.
I think the issue you have is that your "RunIf" link is before the iterator, and therefore it's not being triggered at the right time.
The image below shows a simplified version, where I list the rows in the spreadsheets and then the file names. If I connected the second subjob to the tFileList_1
component, as you did in the question, I only get the logs from tLogRow_1
and the last filename by tLogRow_2
.
With the link as shown, behind the iterator, then I get spreadsheet contents listed and then the title of it:
Col1|Col2|Col3
A|B|C
D|E|F
A.xlsx
Col1|Col2|Col3
A|B|C
D|E|F
B.xlsx
Col1|Col2|Col3
A|B|C
D|E|F
C.xlsx
I am assuming that you have filted out the duplicated files in the tMap
component, so if you link your second subjob from the disponsibilite_3d
component, I think you will get the result you are looking for.
edited Nov 21 at 13:29
answered Nov 20 at 13:24
Screwtape
450315
450315
thank you @Screwtape but witch i want is to get only the name of file used in the job (disponibilite_3G in this case ) to save it into a table mysql and not names of all directory files any help please
– huda tt
Nov 21 at 13:59
Does your tMap filter the files that aren’t used, so that it only gets to the database update when the file hasn’t already been used?
– Screwtape
Nov 21 at 14:02
yes that's which i want , this filter in the tfilelist i don't know how i can do it , sorry but i am beginner in talend
– huda tt
Nov 21 at 14:06
I try to select the file names of the DB table with tmysqlinput and then compare the value with the current file name to check if it does not exist already does not exist already
– huda tt
Nov 21 at 14:13
add a comment |
thank you @Screwtape but witch i want is to get only the name of file used in the job (disponibilite_3G in this case ) to save it into a table mysql and not names of all directory files any help please
– huda tt
Nov 21 at 13:59
Does your tMap filter the files that aren’t used, so that it only gets to the database update when the file hasn’t already been used?
– Screwtape
Nov 21 at 14:02
yes that's which i want , this filter in the tfilelist i don't know how i can do it , sorry but i am beginner in talend
– huda tt
Nov 21 at 14:06
I try to select the file names of the DB table with tmysqlinput and then compare the value with the current file name to check if it does not exist already does not exist already
– huda tt
Nov 21 at 14:13
thank you @Screwtape but witch i want is to get only the name of file used in the job (disponibilite_3G in this case ) to save it into a table mysql and not names of all directory files any help please
– huda tt
Nov 21 at 13:59
thank you @Screwtape but witch i want is to get only the name of file used in the job (disponibilite_3G in this case ) to save it into a table mysql and not names of all directory files any help please
– huda tt
Nov 21 at 13:59
Does your tMap filter the files that aren’t used, so that it only gets to the database update when the file hasn’t already been used?
– Screwtape
Nov 21 at 14:02
Does your tMap filter the files that aren’t used, so that it only gets to the database update when the file hasn’t already been used?
– Screwtape
Nov 21 at 14:02
yes that's which i want , this filter in the tfilelist i don't know how i can do it , sorry but i am beginner in talend
– huda tt
Nov 21 at 14:06
yes that's which i want , this filter in the tfilelist i don't know how i can do it , sorry but i am beginner in talend
– huda tt
Nov 21 at 14:06
I try to select the file names of the DB table with tmysqlinput and then compare the value with the current file name to check if it does not exist already does not exist already
– huda tt
Nov 21 at 14:13
I try to select the file names of the DB table with tmysqlinput and then compare the value with the current file name to check if it does not exist already does not exist already
– huda tt
Nov 21 at 14:13
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53383836%2ftalend-get-current-filename%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Welcome @huda_tt. Can you try to give a bit more detail about what is happening? Could you include examples? When you say "it always returns" can you say what "it" is? Where are you trying to get the filename from? In which component?
– Screwtape
Nov 20 at 9:30
hi @Screwtape I want to extract the current filename first in the "tdatabaseinput" to make the query {"SELECT
processedfile
.NOM
FROMprocessedfile
WHERE NAME = '" + ((String) globalMap.get ("tFileList_1_CURRENT_FILE")) + "'" } if it does not already exist I want to insert it (current file name) in the mysqltable "prossedfile" using "tfixedflowinput" but the value inserted is always the same ~$B.xlsx– huda tt
Nov 20 at 9:56
The link between tFileLink_1 and tFixedFlowInput_1 is not iterating - it will only pick up the (first/last?) iteration. Try running your subjob from a "run if" from the "disponibilite_3g" component, or even the map component.
– Screwtape
Nov 20 at 10:20
ok @Screwtape i try to do this job to extract current filename and identifie the probleme [enter image description here][1] but i still have the name of latest file [enter image description here][2] [enter image description here][3] [enter image description here][4] [1]: i.stack.imgur.com/FFjk3.png [2]: i.stack.imgur.com/Ia6RW.png [3]: i.stack.imgur.com/wi3bW.png [4]: i.stack.imgur.com/ETqOu.png
– huda tt
Nov 20 at 12:44