Transposition of 2 rows and 10 columns contained in a txt file

One Star

Transposition of 2 rows and 10 columns contained in a txt file

Dear all,
As i am new to talend i am having problem transposing 2 rows and 10 columns
The rows and columns are contained in a txt file...but some how the job is created
for only a single such file now i want to transpose for min10 such files
The exact scenario is i have a main folder which has 10 subfolders
each of which contain such file.so need to use the same job for all these
files .How to go about it?
Moderator

Re: Transposition of 2 rows and 10 columns contained in a txt file

Hi,
As i am new to talend i am having problem transposing 2 rows and 10 columns
The rows and columns are contained in a txt file...but some how the job is created
for only a single such file now i want to transpose for min10 such files
The exact scenario is i have a main folder which has 10 sub folders
each of which contain such file.so need to use the same job for all these

Your requirement is not very clear for us. Do you want to transpose row to column? Or you want to move your .txt file with 2 rows and 10 columns from your sub folders into another target folder? More information will be appreciated.

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Transposition of 2 rows and 10 columns contained in a txt file

Hi,
Yes i want to transpose rows into columns.These rows and columns
are in text files.I have created the job which transposes rows into columns
for one such file,now i want to use the same job for different such files which
is present in different subfolders under a main folder also having 2 rows and 10 columns as mentioned

Hope, now the requirement is clear

Regards,
Ojas
Five Stars

Re: Transposition of 2 rows and 10 columns contained in a txt file

design a job like below
tFilelist----iterate----tFileInputDelimited-----output

in tFilelist select check box for include sub-folder
tFilelist has many Global properties so used file with path property in tFileinputDelimited component for file name.
Moderator

Re: Transposition of 2 rows and 10 columns contained in a txt file

Hi,
Please see the component reference tFileList with a scenario for details. As @umeshrakhe said, you should check out the option of "includes subdirectories "
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Transposition of 2 rows and 10 columns contained in a txt file

Hi,
I tell you exactly how i designed it for 2 rows and 10 columns
tfileinputfullrow ------>tnormalize ----->tmap1------->tmap3----------->tfileoutdelimit
| (lookup)
|
tfileinputfullrow-------->tnormalize------>tmap2---------

here tfileinputfullrow1 will process only first row by setting limit as 1 n header 0
here tfileinputfullrow2 will process the second row by setting limit as 1 n header 1
in tmap1 i have added one col line_no with expression Numeric.sequence("s1",1,1)
in tmap2 i have done the same thing bt expression here is Numeric.sequence("s2",1,1)
then after lookup in tmap3 i have added t cols ie Col1 & Col2 and mapped accordingly
the file contains :
A B C D E F G H I J
col1 col2 col3 col4 col5 col6 col7 col8 col9 col10

its transpose is
A col1
B col2
..so on
similarly there are 10 files i need to transpose it all using same job

Also if there is any other way for transposing rows into columns
as the above job is for only 2 rows n 10 columns ,so there could be
n rows and n columns
Please help
Regards,
Ojas
Moderator

Re: Transposition of 2 rows and 10 columns contained in a txt file

Hi,
I think the two articles about Converting rows to columns and Converting columns to rows on Talend Help Center can help you to deal with such similar issue.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Transposition of 2 rows and 10 columns contained in a txt file

Hi,
Thank you for the reply,i tried it
but i am not getting the desired output
regards,
Ojas
Moderator

Re: Transposition of 2 rows and 10 columns contained in a txt file

Hi,
What is your actual result? Could you give us the screenshot of your workflow?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Transposition of 2 rows and 10 columns contained in a txt file

Hi sabrina,
reading all posts about columns and rows in excel, i have an importan question about my problem:
My excel file is transposed (on first row i have the keys and the records are stored by columns).
Now i'm using tdenormalize to compact column and to rewrite them by rows, but i don't know how many records i can process...
Is there a way to use the component tmap "by column" not by rows? so it would be nice and less complicated.
Thank you in anticipation
P.S. TturnRow component is not usefull because excel file is in x,y x not like y
Tomas
Moderator

Re: Transposition of 2 rows and 10 columns contained in a txt file

Hi,
Due to the variable, tMap deal with "row" in stead of "Column". (see my screenshots)
Could you please elaborate your case with an example with input and expected output values? Maybe there is a proper component for your requirement.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Transposition of 2 rows and 10 columns contained in a txt file

Ok, the problem is posted by many users but unresolved. Is TRANSPOSE excel files (columns begins rows)
No Tturnrow, UnPivot or other components may help me.
Unfortunately who give me this excel file don't understand what are fields and records.
The schema is :
ID ; 1 ; 2 ; 3 ; 4
NAME ; William ; Joe ; Lara ; Bob
SURNAME ; Brown ; White ; Red ; Green
and so on for 348 fields (first column fieldsname, every columns a record)
I need to put this records in a SQL server table, but for processing i need to TRANSPOSE
ID ; NAME ; SURNAME
1 ; William ; Brown
2 ; Joe ; White
3 ; Lara ; Red
4 ; Bob ; Green
Now i use
texcelinput -- tfiltercolumn(singlecolumn) -- tdenormalize -- tfileoutputdelimited(in append)
But :
1) excel files have no schema due to records (maybe 1 column(record) maybe 20 columns)
2) due to columns i have to repeat the flow 1 or 20 times due to filter single columns
If there is a component that can rotate this file i finish my problems.....
Sincerely