Adding an extra column to the delimited input file
Hi,
I download tab delimited files from an ftp server. The number of columns in the files vary and are between 5 and 15 columns. Some of the files are as below.
YAHOO_keyword_20101127.txt --- contains 5 columns
YAHOO_detail_20101127.txt --- contains 8 columns
I am using tInputFileDelimited to read these files and change the encoding and delimiter of the file and writing to another file using tOutputFileDelimited.
I would like to add another column to the file created by tOutputFileDelimited component. The extra column will be the date (20101127)in the name of the file itself.
Here is an example of what I need to do.
Input File:
col1 col2 col3 col4 col5
a b c d e
b c d e a
Output File wanted:
col1 col2 col3 col4 col5 date_created
a b c d e 20101127
b c d e a 20101127
The date value comes from the file itself.
I would really appreciate if someone can help me with this. I was also trying to use the tmap component but was not able to achieve what I described above.
Thank you,
Santhosh.
Thank you Vaibav,
I'm not able to upload screenshots into the forum.I don't know how to do?
I'm tried to upload already but could not able to upload.
Ya I'm adding newcolumn in the metadata and not including newcolumn= while writing expression.
When my expression includes input column which I mapped,I could get output.
Example column5= (row1.column2)*10 got ouput.
But when column6=Column5*10
(column5 is previous output which is not mapped from input)
Ya I tried like that I got ouput but if there is no relation to newcolumn with the input columns what could be the solution. I told you just example that is not my exact requirement. If I want to add some if else condition to my input how could I write?
Please Help!
Good afternoon:
I am extremely new to Talend and do not know Java. I will not be using Talend much in future as our IT department will take over. But I have spent the last 1.5 weeks studying the guide and the components guide and am pretty clueless as to how to create the job to accomplish my task. I am not even sure I can perform it within the parameters my boss has given me, as he knows less about Talend than I do. Here is my task:
Overall task, take 39 different 97-2003 excel files, different headings, different numbers of rows, compile into one upload to a redshift table.
Facts:
1. The redshift table will have all the various fields from all the different excels.
2. The excels do not have all these fields.
3. I have assumed I must bring in the raw data, and perhaps tmap it to another table whose schema has all the fields listed in the redshift table.
What is the best flow to open an excel file with 10 rows, append it to another "table" that has 30 rows, and hard code the value into the 20 fields that do not have an input value from the original input file, then append to one output that will be uploaded to redshift. I have mapped a schema for each raw data excel file as each one will have different hardcoded values for the empty fields. I have experimented a zillion ways, it seems, but because I do not know Java, I am unable to figure out the error codes. I also apologize if I should have started a new thread, but I found this one by googling for "adding an extra column to the delimited input file". Thank you.
I can attach samples if needed but basically:
excel raw data rows for file 1: tmap to output or ????
1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
m k l a c g h k n 6 m k l a c g h k n 6 JJ kk ll mm no cc
I have a Use case where i have 5 columns say a,b,c,d,e in a file Input.csv which needs to be looked up for validation in a master file say Master.csv. The resultant output should be a csv where all the matching records from the master file should be retrieved. I used a tmap to apply the processing logic and join conditions but one thing i need in the resultant file is that whenever the input file is failing to find a matching record in master file an additional column should be added in the resultant file wherein the status should mentioned "Failed as no matching records for "a,b.c...etc" are found.This i am unable to do using tmap. I have added additional 5 columns but what should i add as logic in the addtional file columns so that for every look up failed criteria the resultant output should tell me that it failed as this value did not match. psl suggest
Hi,
scenario is
1.first download the file from ftp it has three columns(name,address,state) and in table Code(id,uniquecode,used) and uniquecode is some integer values
2. we have to add a coulmn to input file uniquecode(name,address,state,uniquecode)
can you please help me how to dump the column from a table.
Many regards,
Rasool.