on ‎2013 Nov 29 10:28 AM
Request clarification before answering.
Hi Mohan,
I suggest to split your workflow in two steps. First you connect the object "Row_Generation" with a query to your flatfile. Set the amount of rows to 4. It will generate 4 lines with an ID field.
In the output schema of your query you can fill the fields with NULL or blank as needed.
In the second step you export your data as usual.
Regards
Jürgen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your kind advise and appreciated for your help.
This is not working as I expected.
Suppose source data table has 100 rows and I want to export it to .txt file. I am expecting to see 4 blank rows + 5th row should be column headers and 100 rows.
Could you please send me atl if possible,
Kind regards
Mohan
Hi,
Not tried, but should work i guess. There is an option in the file format editor 'Skip rows'. You can enter a value there to skip rows.
Have you tried that?
The easiest option would be to insert a post load command with SQL query in a template table and convert template table to text file.
Thanks,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much guys for your kind help. Both (Jürgen &Ancy) scenarios were tried and worked as expected. Thanks alot to Jurgen & Ancy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mohan,
Skip rows opton of the File Format would not serve the requirement as it will skip the specified number of rows of the existing rows of the data being loaded.
Keep the data load flow normal with the Skip row header as NO and Load the data into a file .
After the load into the file join a Script to the data flow executing unix command to prepend the new line to the existing file.
Flow:
Dataflow--->Script.
Unix script can perform following steps :
But this scenario could take time if the file being loaded is huge.
So better would be to get a Unix script to prepend lines to existing file without using the temp file.
Regards,
Rishabh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mohan,
Use a BODS script to insert new lines into the file before calling them in DF.
For eg: (if Windows)
In script have :
1)delete the prev run target file present in folder
2) Insert new line to file.
exec('cmd','for %1 in (1 2 3 4) DO echo.>> C:\Users\A\Desktop\M1.txt',8);
3)After script have the DF with target text file with Write row headers enabled and delete file assigned to 'No'.
Now the target should have 4 newlines before the row header.
Similary if the OS is unix have unix command to insert new line.
Thanks,
Ancy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 9 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.