Professional Documents
Culture Documents
Load The Data Into A Flat File and Atleast Leave First 4 Rows Blank
Load The Data Into A Flat File and Atleast Leave First 4 Rows Blank
Regards
Jrgen
Arun Kumar
Re: Write(load) data into flat file. Nov 29, 2013 2:54 PM
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
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
Nagabhushanam Gorantla
Re: Write(load) data into flat file. Dec 4, 2013 5:05 AM
Hi Mohan,
Did you try looking into the options in File Format Editor? Please look into the attachment.
Cheers
Nagabhushanam G
File_Format_Editor.JPG 26.6 K
Flow:
Dataflow--->Script.
Unix script can perform following steps :
Move the content of the existing file with data to a temp file,
add the required number of line to the existing file,
append the data from the temp file.
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
In query write ifthenelse statement .as below to get the 5th row as header