Add char strings in the flat file
Hi allI need to insert in a flat file, the string "BEGINNING OF FILE" at the top of the file before the header and the string "END-OF-FILE" at the end of the file. I use KM 'IKM SQL to the file Append' and ODI.
I need your help!
Thank you.
Giovanni Albetti
Hi Giovanni
I did some tests here and procedures using an os command looks like:
I understand that you are under windows.
1) put the first procedure with something like:
echo START OF FILE > MyFile.txt
(2) run you interface where myfile.txt is your target. Do not use the option Truncate
(3) to the second procedure just write:
echo END OF FILE > MyFile.txt
There is no more simple...
Make sense?
Tags: Business Intelligence
Similar Questions
-
How to add a string to the end TLFTextField without losing the current text format!
- I have a TLFTextField which loads the text of the external text file.
- Then a function changes the format of certain parts.
- Then, as soon as I add a string to the end my TLFTextField, all previous formatting is lost!
I use this code to add the string:
- myTLF.text += ".";
or
- myTLFText.text = myTLFText.text.concat(".");
Should I use another method?
pass again the text through your function put shaped, or try appendText:
- myTLF.appendText(".");
-
Where to download the flat file for POC adapter
Hi all
We are currently looking at GoldenGate as a mechanism to capture changes to tables specified in an Oracle database and produce text files containing these changes in near real-time. Everything I read pointing adapter flat file for GoldenGate as a way to get there.
I am now at the point where I want to start a little POC see prove if it will work for our needs. I downloaded GG for databases Oracle 12.1.2.1.0 RTO, as well as customer GG monitor and Director of GG. My question is now - where can I download the flat file adapter? It includes the GG for the download of Oracle?
If I missed something in the documentation somewhere - I'm happy to be told where to read them.
Kind regards
John
I'll answer my own question here...
(1) delivery seems to be the only place to get it
(2) 12 GoldenGate can capture a trail and send it to a configuration of GoldenGate 11 running FF adapter.
-
Export a table for the flat file and must insert sysdate in flat file column
Hi, I created an interface allowing to export an oracle table to a csv file. All the columns in the table work well. Then I need to insert the sysdate in a column in the csv file.
I made the map as working in the transit area, implementation is to_char(sysdate,'dd/mm/yyyy'). But the result is insert in column 14.
I tried to create a variable refreshing that choose double to_char(sysdate,'dd/mm/yyyy'), maps then as the csv file column, but he only insert 1 row and the format is YYYYMMDD.
I tried to use SELECT '< % = odiRef.getSysDate ("YYYYMMDD") % >' double to the variable and it also only insert a line in the flat file.
I used the same methodology in ODI10g, it works fine.
So, I wonder how it can be implemented in 11g.
Thank you
It turns out that I used the snapshot_date as a field name, it may be a reserved word. After that I changed the name of the field, it works fine. Thank you.
-
KM for the flat file to flat file
Hello
Including KM to use for the flat file to flat file extraction.
Thank you.Hello
Use LKM FILE SQL and SQL IKM FILE APPENDIX
Make sure that the file exists and your waiting area is facing a pattern of RDBMS
Thank you
Fati -
Remove users from UDF attribute of unique values present in the flat file
Hello
I'm trying to remove users from the IOM by using a single value of one of the present of the UDF in the flat file for example say SSN. I preferred the approach to go through a scheduled task to remove users from IOM. I know that the permanent deletion of IOM through the database is not possible. To have written a custom code to do the same thing and I have used the tcuseroperationintf.deleteuser(long...) method. But I had a straight and simple query for the same thing. Should what value I contact in the long appropriate field in the list of the attributes of this method?
Any guidance on this task would be appreciate.
Thanks in advance,
-oidm.You want to the Users.Key or the USR_KEY and give it in the format of variable length.
-Kevin
-
Analyze the flat file data in a nested structure.
This has been driving me crazy all day long.
I have a flat data file I want to analyze in a nested data structure.
Small sample data:
0 HEAD 1 SOUR FTW 2 VERS Family Tree Maker (16.0.350) 2 NAME Family Tree Maker for Windows 2 CORP MyFamily.com, Inc. 3 ADDR 360 W 4800 N 4 CONT Provo, UT 84604 3 PHON (801) 705-7000 0 TRLR
If anyone recognizes this, yes it's a small piece of a GEDCOM file. That's what I'm trying to analyze. For someone who is not familiar with this data format. The first number is the level of a data element. Level 0 are elements of the root of a data segment. Level 1 lines relate to the data of level 0 line previous closest. Level 2 lines relate to the level 1 data line that precedes the closest. And so on.
Here is an example of the desired output, the different elements to the related parent of nesting.
<cfset foobar = { HEAD = {lvl=0, SOUR = {lvl=1,data="FTW", VERS = {lvl=2,data="Family Tree Maker (16.0.350)"}, NAME = {lvl=2,data="Family Tree Maker for Windows"}, CORP = {lvl=2,data="MyFamily.com, Inc.", ADDR = {lvl=3,data="360 W 4800 N", CONT = {lvl=4,data="Provo, UT 84604"}}, PHON = {lvl=3,data="(801) 705-7000"}}}}, TRLR = {lvl=0} }> <cfdump var="#foobar#">
I think I'm looking at a kind of recursive function to embed these data correctly, but I just can't figure out how to do.
I have this basic function that will display each line of data in a separate structure key
<cffunction name="parseFile"> <cfargument name="file" required="yes"> <cfargument name="line" required="no" type="string" default=""> <cfscript> var returnStruct = structNew(); var subStruct = structNew(); var cur_line = ""; var next_line = ""; var line_lvl = ""; var line_key = ""; var loop = true; if (len(trim(arguments.line)) EQ 0) { cur_line = fileReadLine(arguments.file); } else { cur_line = arguments.line; } do { if (not FileISEOF(arguments.file)) { next_line = fileReadLine(arguments.file); } else { next_line = "-1"; loop = false; } line_lvl = listFirst(cur_line, ' '); cur_line = listRest(cur_line, ' '); line_key = listFirst(cur_line, ' '); cur_line = listRest(cur_line, ' '); returnStruct[line_key] = structNew(); returnStruct[line_key]["level"] = line_lvl; cur_line = next_line; } while (loop); return returnStruct; </cfscript> </cffunction> <cfscript> gedcom_file = FileOpen(getDirectoryFromPath(getCurrentTemplatePath()) & "Ian Skinner.GED","read"); /*gedcom_data = {individuals = structNew(), families = structNew(), sources = structNew(), notes = structNew()};*/ gedcom_data = parseFile(gedcom_file); </cfscript> <cfdump var="#gedcom_data#" label="Final Output">
I tried many ways to recursively call this function in order to nest the elements. None of them have produced await in the above example of hand coded output. Which made me the closest is recursive call, the function parseFile() towards the end of the while loop if the following line is greater than the current level of line:
if (listFirst(next_line,' ') GT line_lvl) { parseFile(arguments.file,next_line); }
It works pretty well, as long as the next level of line is the same as or higher than its previous level of the line. But once the next line level is lower, the recursive call will not return to the appropriate parent level. The current function call ends just on a loop on the data file. Everything that I tried to provide a correct output for recursive function calls when the next data line belongs to a line parent just a horribly distorted data.Yes, that's exactly it. I think that the node must always be added to the stack.
I just had a period gave me. But that's what I thought.
That is to say...
While (not FileISEOF (gedcom_file)) {}
line = fileReadLine (gedcom_file);
extract data from the node
node = {};
node.LVL = listFirst (line, "");
line = listRest (line, "");
key = listFirst (line, "");
If (listLen (line, "") gt 1) {}
node. Data = listRest (line, "");
}
Download the most recent ancestor of the battery
lastNode = stack [1];
If it is a brother/ancestor, look for its parent
While (arrayLen (stack) & node.lvl lte lastNode.lvl) {}
arrayDeleteAt (battery, 1);
lastNode = stack [1];
}
Add to the stack
arrayPrepend (stack, node);
Add this node from its parent
lastNode [key] = node;
}
-
Could not load the flat file (csv) through FDMEE
Hi Experts,
I am trying to load data from flat file to HFM via FDMEE, it throws the below error
2014-06-06 16:35:13, 465 INFO [AIF]: beginning of the process FDMEE, process ID: 1 341
2014-06-06 16:35:13, 465 [AIF] INFO: recording of the FDMEE level: 4
2014-06-06 16:35:13, 465 [AIF] INFO: FDMEE log file: d:\orcl\FDMEE\outbox\logs\CONSOL_1341.log
2014-06-06 16:35:13, 465 [AIF] INFO: User: hyp_admin
2014-06-06 16:35:13, 465 [AIF] INFO: location: HFM UXC (Partitionkey:59)
2014-06-06 16:35:13, 465 [AIF] INFO: period name: Apr-14 (period key: 1/04/14 12:00 AM)
2014-06-06 16:35:13, 465 INFO [AIF]: name of the category: real (main category: 4)
2014-06-06 16:35:13, 465 [AIF] INFO: name rule: HFM UXC D300 (rule ID:69)
2014-06-06 16:35:15, 785 [AIF] INFO: Jython Version: 2.5.1 (Release_2_5_1:6813, September 26 2009, 13:47:54)
[JRockit (R) Oracle (Oracle Corporation)]
2014-06-06 16:35:15, 785 [AIF] INFO: Java platform: java1.6.0_37
2014-06-06 16:35:15, 785 [AIF] INFO: log the file encoding: UTF-8
2014-06-06 16:35:19, 132 [AIF] INFO: - START IMPORT STEP -
2014-06-06 16:35:25, 188 [AIF] INFO: file name: UXC_D300_Apr - 14.csv
2014-06-06 16:35:25, 360 FATAL [AIF]: error in Comm.doScriptInit
Traceback (most recent call changed):
File '< string >", line 347 in doScriptInit
Exception: java.lang.Exception: NO details found for Loadid:13412014-06-06 16:35:25, 655 FATAL [AIF]: load balances data launch GL error
2014-06-06 16:35:25, 671 INFO [AIF]: end process FDMEE, process ID: 1341The pointers will be greatly appreciated.
Thank you very much
Jeff
This error is usually related to if you do not properly apply patch ODI.
Can you take a look at the opatch inventory, rollback FDMEE and ODI patch and then apply again.
Make sure that these patches are applied successfully without any errors.
Thank you
~ KKT ~. -
Create the flat file data from the oracle table
d_adp_num char (10)
d_schd_date tank (8)
d_sched_code tank (25)
d_pay_code char (50)
d_mil_start char (4)
d_mil_end char (4)
d_duration char (5)
d_site_code char (4)
d_dept_id tank (6)
Select payroll_id,
schedule_date,
reason_code, (sched_code)
reason_code, (pay_code)
start_time,
end_time,
total_hours,
site_code,
department_id
of dept_staff
where schedule_date between (sysdate + 1) and (sysdate + 90)
loading data for the date range instead.
sched_code - if 'Unavailable' reason_code = 'OD' and 'THE '.
pay_code - "Berevevement BD" If reason_code = "BD".
"UP PTO without reasonable excuse" If reason_code = 'UP '.
"RG" If reason_code = "SH".
"PTO" If reason_code = "GO".
Here are some...
start_time and end_time - convert military time
based on start_ampm and end_ampm
On this basis, I need help to create a flat file. Sewing of the flat and data file in dept_staff sample
If site_code is there so no need to get department_id (see the sample flat file)
------------------------------------
examples of data to flat file
ZZW002324006072012 PTO
0800160008.00
ZZW002428106072012 RG
1015174507.50HM34
ZZW002391606072012 RG
1100193008.50
ZZW002430406072012 RG
1100193008.50 130000
----------------------------
dept_staff table data
REASON_CODE_1 PAYROLL_ID SCHEDULE_DATE REASON_CODE START_TIME, END_TIME START_AMPM END_AMPM TOTAL_HOURS SITE_CODE DEPARTMENT_ID
ZZW0024468 08/06/2012 HS HS 730 HAS 400 850 12 P
ZZW0000199 08/06/2012 HS HS 730 HAS 400 850 14 P
ZZW0023551 08/06/2012 SH SH 1145 A 930 975 GH08 95 P
ZZW0024460 08/06/2012 SH SH 515 HAS 330 P 1025 GH08 95
ZZW0023787 08/06/2012 SH SH 630 HAS 300 850 24 P
ZZW0024595 08/06/2012 TR TR 730 HAS 400 850 90 P
ZZW0023516 08/06/2012 OD OD 800 HAS 400 800 95 P
ZZW0023784 08/06/2012 OD OD 800 HAS 400 800 5 P
ZZW0024445 08/06/2012 SH SH 1145 A GH08 930 975 5 P
ZZW0024525 08/06/2012 OD OD 800 HAS 400 800 23 P
ZZW0024592 08/06/2012 TR TR 730 HAS 400 850 5 P
ZZW0024509 08/06/2012 SH SH 95 MK21 830 HAS 330 P 700
ZZW0023916 06/14/2012 SH SH 1100 A 850 27 730 PHow to ask questions
SQL and PL/SQL FAQUTL_FILE allows to write the OS file
-
Hello
My Source is access DB and target is flat file.
The IKM I use is IKM SQL to add files.
When I try to run the Interface, I get this error: -.
3100: 37000: java.sql.SQLException: error [Microsoft] [ODBC Microsoft Access driver] syntax (missing operator) in query expression ' CUSTOMER. [CustomerID] CUSTOMERID "."
java.sql.SQLException: error [Microsoft] [ODBC Microsoft Access driver] syntax (missing operator) in query expression ' CUSTOMER. [CustomerID] CUSTOMERID "."
at sun.jdbc.odbc.JdbcOdbc.createSQLException (unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError (unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLPrepare (unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement (unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement (unknown Source)
at com.sunopsis.sql.SnpsQuery.a (SnpsQuery.java)
at com.sunopsis.sql.SnpsQuery.a (SnpsQuery.java)
at com.sunopsis.sql.SnpsQuery.updateExecStatement (SnpsQuery.java)
at com.sunopsis.sql.SnpsQuery.executeQuery (SnpsQuery.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders (SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt (SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt (SnpSessTaskSqlI.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask (SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep (SnpSessStep.java)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession (SnpSession.java)
at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand (DwgCommandSession.java)
at com.sunopsis.dwg.cmd.DwgCommandBase.execute (DwgCommandBase.java)
at com.sunopsis.dwg.cmd.e.i (e.java)
at com.sunopsis.dwg.cmd.g.y (g.java)
at com.sunopsis.dwg.cmd.e.run (e.java)
at java.lang.Thread.run (unknown Source)
Would appreciate the help.
ChanduwarHi Chandwar,
As we discussed in Gtalk,
the problem is the quotes in the select query.Select
CUSTOMER. "" ' Town.
CUSTOMER. "' Region '.
'Customer' as a CUSTOMER
where (1 = 1)Please customize step KM
<%=snpRef.getColList("", "[EXPRESSION] [ALIAS_SEP] [CX_COL_NAME]", ",\n\t", "", "INS and !TRG") %>
to remove the quotes and the expression of the Alias
Please reffer to the PDF API user to customize the same.An additional point->
Please try to use the appropriate kms which is dedicated for each technology,
This will improve the performance and this kind of questions.Kind regards
Its -
Write the string to the ini file problem
I was tring to write a string in an ini file, which should be:
[Basic information]
File Name=C:\\11111.docbut the result is:
[Basic information]
File Name="C:\\11111.doc.whence the double quote come?
got it, thanks
-
How to view the flat file to ADF Flow task data
Hello
I have some data in a flat file.
Now, I want to show the data in a table in the workflow of adf.
Please help me to know how to achieve this functionality.Hello
Have a look here: http://dstas.blogspot.de/2012/11/csv-files-with-adf-csvparser-example.html?m=1
Once the file is loaded in a query of the VO, the workflow can construct the table by dragging the VO
Frank
-
Of size zero image blob in the flat file DB
Hello friends,
I am just new on ODI 11 G.
Try to load images of flat filesystem from unix to Table DB using ODI 11 G.
The image loaded by '0' File size - IE empty. I don't understand.
Here the log files, control files and exit the generated file.
CTL file:
" )
Appreciate your quick response.
Thank you/kumar
Published by: kumar73 on July 3, 2012 07:13Check the code you have. Your chemin_image is a FILLER. Thus, the LOBFILE charge NULL in the DB.
-
How to recover a database after you add a data since the last file backup.
How to recover a database after you add a data file to a tablspace existing since the last user managed backup.
PS: I am aware that the user managed backups are not used and RMAN is used these days.At the stage of the mount: select name from v$ datafile;
The last entry indicates a file named /xxx/xxx/.../UNNAMEDXXX.dbfNow
ALTER database create datafile ' / xxx/xxx/.../UNNAMEDXXX.dbf' as 'path_where_you_want_to_add_the_datafile ';
The name of the data file must match the name that added in production
This will create a data file to the required location.
Once the file has been created, you can continue with recovery.
-
How to add a field for the multiple file upload in WebApps?
I create a Web application for the user to record certain information with multiple images. I only see a single uploader.
How can I add multiple image uploader and how do I create an upload field instead of a custom file upload image?
Hello
There is no other type of upload for web applications field. You will need to use the 'image file type"to apply to multiple file upload fields in the form of web application in this case.
Kind regards
-Sidney
Maybe you are looking for
-
ZTE open, where is the microSD? couldn't find it?
Open just received ZTE, camera apps requires "memory card", but there is no physical slot for microSD card?
-
Satellite L50 - A - display on the screen turned sideways
I have a laptop computer L50 - A Satellite. Almost, I disabled the touch-pad - the cursor is now worked by a mouse, but if I happen to touch the touchpad while typing, all kinds of things happen, and I'd rather it off altogether. My major problem is
-
H520 Lenovo graphics card update
Hello I have a H520 with raeadon i7-3770 and amd HD 8570 (OEM), I can change the graphics amd for a GTX 650 or 750? without changing the PSU, also this PSU is a hunting with 240W key which is enough? and btw is has sufficiently pins. I never change o
-
Why phot out much darker when printed that they are on a camera Any Solution?
-
How can I buil labview program for the area and the curls on top of video analysis?
LabVIEW program building...