Trouble extracting data from a previously written file
I am trying to extract two arrays from a previously written file, which contains two arrays, seperated by a /t char. The files are saved in this format;
Wavelength(nm)ower(W):
*lambda1**power1*
*lambda2**power2*
"lambda#" and "power#" are both actually numbers, but I wanted to illustrate that they correlate.
Furthermore, with the extracted data, I would like to write a new file, which uses the information (during another sweep) to calculate a third value (called EQE), which is dependant on the power and current at a given wavelength. So while the VI is reading current per lambda, it should also be able to find out what the power value at said lambda was and calculate the EQE.
The VIs I have so far are attached. The third portion of "problem.vi" is enclosed in a while loop, so it repeats a lot of times.
Thank you very much
Solved!
Go to Solution.
Attachments:
Problem.vi 36 KB
MAELV wrote:
How would I begin from the second line?
Use a Read Text File function. Right-click on it and there will be an option to read lines or characters. If you set it to read lines and leave the number unwired, it will by default read a single line. You don't care about the header data, so don't worry about the output unless you want to show it on the front panel for debug reasons. From there, read the rest of the file as you already have.
MAELV wrote:
When I have execution highlighted, the wavelength index number seems to get stuck fairly quickly (at say #51) where as the power index continually lower to zero.
I'm not sure what you mean by this. Can you post an example file as well so I can play around with what you are seeing?
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Attachments:
Read Lines.png 5 KB
Similar Messages
-
How to extract data from Essbase to Flat File using ODI
Hi,
Anyone know how to extract data from Essbase to Flat File using ODI?
Thanks in advance.
Regards,
SumardiHi,
Have you read through :-
Oracle Data Integrator Adapter for Hyperion Essbase Getting Started - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_getting_started.pdf
Oracle Data Integrator Adapter for Hyperion Essbase User's Guide - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_users.pdf
If you have read them and are still have a problem at what stage are you having the issues?
Cheers
John
http://john-goodwin.blogspot.com/ -
Extract data from Oracle in excel file
Hi,
I have a requirement where in I need to extract data from Oracle in excel file and the excel worksheet name should be "Data".
for eg. excel file name "AR Data_DDMMYY" and excel worksheet name "Data"
I have used the UTL_FILE API to extract the tab delimited data which can be opened in excel but it is not exactly an excel file as the worksheet name is same as the file name.
I tried using utl_file.fcopy and frename.
Is there any way to do this using PLSQL?
select * from v$version;
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
"CORE 10.2.0.5.0 Production"
TNS for HPUX: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - ProductionSample Code:
declare
cursor c is
select * from scott.emp;
v varchar2(100);
f utl_file.file_type;
file_name varchar2(100) := 'AR Data.xls';
dir varchar2(50) := 'CESDIR191710';
--select * from dba_directories
begin
f := utl_file.fopen(dir, file_name, 'W');
v := 'EMPNO'||chr(9)||'ENAME'||chr(9)||'JOB'||chr(9)||'SAL'||chr(9)||'HIREDATE'||chr(9)||'DEPTNO';
utl_file.put_line(f, v);
for i in c
loop
v := i.empno||chr(9)||i.ename||chr(9)||i.job||chr(9)||i.sal||chr(9)||i.hiredate||chr(9)||i.deptno;
utl_file.put_line(f, v);
end loop;
utl_file.fclose(f);
--utl_file.frename(dir, file_name, dir, replace(file_name, '.xls', '_')||to_char(sysdate, 'MMDDYY')||'.xls', false);
utl_file.fcopy(dir, file_name, dir, replace(file_name, '.xls', '_')||to_char(sysdate, 'MMDDYY')||'.xls');
end;Thanks
ImranImran Soudagar wrote:
Hi,
I was able to generate the excel 2007 file with the data using the package from below link;
http://technology.amis.nl/2011/02/19/create-an-excel-file-with-plsql/
but the requirement is to generate excel 2003 file.
I tried changing the .xlsx to .xls and it gives a note while opening the file "The file you are trying to open, abc.xls, is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?"Then you have three options:
1) stop using anton's package and find another one that supports the old and deprecated version of Excel 2003
2) write your own package to produce an Excel file.
3) Upgrade your version of Excel to a recent version
I tried the programs from other links on the forum but I am still getting this message. The client does not want this message to be displayed as the excel file works as an input to another system.
Can anyone help me with the issue?
Also, is it true that the programatically generated excel file is actually an xml file which is renamed to .xls and hence it shows the message while opening such files?Yes, Excel supports several different formats for it's files. By default, if you save an XLS files from Excel, it writes it out in a Microsoft proprietary binary format, which you would be hard pushed to replicate easily from PL/SQL. Excel also has the ability to save it's files as XML format, which is more readable and easier to produce programatically, whilst still allowing you to have multiple sheets, formulas and formatting included in it. That's the format that most people who need formatting and multiple sheets opt for when programatically generating their data as excel workbooks. (There's also an SLYK format that people used to use before that, but it's not as flexible)
If you want to write your own, the easiest thing to do is to start with a blank workbook in Excel, and put in your basic requirements e.g. a couple of named sheets, and some data in different formats (number, date, text etc.) and different formatting options etc. Save that file in XML format from Excel and then open up the file using notepad/wordpad to look at the structure. There'll be a whole load of redundant rubbish Microsoft put in there, but you should be able to figure out the basic structure of XML required to give you what you want. -
How to extract data from an arbitrary xml file and export in a nice csv file?
Hallo,
I'm facing big problems in the use of XML files. I have an
application which generates XML files with clusters containing arrays
and scalars like in the example pasted below. My task is to
read it and export the data in a human-friendly CSV document.
Since I don't know the actual content of the cluster, I need some kind
of intelligent vi which goes through the XML file looking for arrays
and other data structures in order to export them properly in the CSV
format (columns with headers).
Thank you
<Cluster>
<Name></Name>
<NumElts>3</NumElts>
<Array>
<Name></Name>
<Dimsize>6</Dimsize>
<I32>
<Name></Name>
<Val>0</Val>
</I32>
<I32>
<Name></Name>
<Val>1</Val>
</I32>
<I32>
<Name></Name>
<Val>2</Val>
</I32>
<I32>
<Name></Name>
<Val>3</Val>
</I32>
<I32>
<Name></Name>
<Val>4</Val>
</I32>
<I32>
<Name></Name>
<Val>5</Val>
</I32>
</Array>
<DBL>
<Name></Name>
<Val>3.14159265358979</Val>
</DBL>
<String>
<Name></Name>
<Val>ciao</Val>
</String>
</Cluster>
Solved!
Go to Solution.Thank you again,
I'm forwarding my vi draft with many comments and an xml file sample.
Data in cluster is stored according to the LabVIEW schema, infact it is generated by LabVIEW.
What I'm trying to do is to access the element of the cluster and read their content using the Invoke node and Property node functions. Could you give it a look, there may be something wrong, I'm not able to access cluster children.
Which funcions should I use? Could you give me an example? You may use the draft I enclosed...
Then write these data in a csv file
should be the easier part.
BODY{font:x-small 'Verdana';margin-right:1.5em}
.c{cursor:hand}
.b{color:red;font-family:'Courier New';font-weight:bold;text-decoration:none}
.e{margin-left:1em;text-indent:-1em;margin-right:1em}
.k{margin-left:1em;text-indent:-1em;margin-right:1em}
.t{color:#990000}
.xt{color:#990099}
.ns{color:red}
.dt{color:green}
.m{color:blue}
.tx{font-weight:bold}
.db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px solid #CCCCCC;font:small Courier}
.di{font:small Courier}
.d{color:blue}
.pi{color:blue}
.cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small Courier;color:#888888}
.ci{font:small Courier;color:#888888}
PRE{margin:0px;display:inline}
<?xml
version="1.0" encoding="iso-8859-1" ?>
<Contents type="Data"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="XMLSection.xsd">
<section name="beta"
date="7/31/2009" time="3:43:03 PM" version="1.0">
<Cluster>
<Name />
<NumElts>1</NumElts>
<Array>
<Name />
<Dimsize>4</Dimsize>
<DBL>
<Name>number: 0 to 1</Name>
<Val>0.93317638164326</Val>
</DBL>
<DBL>
<Name>number: 0 to 1</Name>
<Val>0.79233924020314</Val>
</DBL>
<DBL>
<Name>number: 0 to 1</Name>
<Val>0.39199947274518</Val>
</DBL>
<DBL>
<Name>number: 0 to 1</Name>
<Val>0.74817197429441</Val>
</DBL>
</Array>
</Cluster>
</section>
</Contents>
Attachments:
read_array.vi 12 KB -
Extract data from Pipe Delimited file
Hi everybody,
Could someone provide me the command to extract data from a pipe delimited file ("|") using Open/Read Data set.
I mean eliminating the delimiter ("|") and just picking the data.
Thanks
MHere you go.. this code snippet parses the input file record by using pipe (variable lv_pipe) as separator, for tab separated file you can use lv_tab like wise...
TYPES: BEGIN OF ts_field,
field(50) TYPE c,
END OF ts_field,
tt_field TYPE TABLE OF ts_field.
DATA: ls_record TYPE string,
ls_input_data TYPE ts_input_data,
lv_tab TYPE x VALUE '09',
lv_pipe TYPE C VALUE '|',
ls_field TYPE ts_field,
lt_field_tab TYPE tt_field,
lv_field_index TYPE syindex,
lv_record_no TYPE syindex.
FIELD-SYMBOLS: <fs_field> TYPE ANY.
OPEN DATASET fv_file_path IN TEXT MODE FOR INPUT.
IF sy-subrc = 0.
DO.
lv_record_no = lv_record_no + 1.
READ DATASET fv_file_path INTO ls_record.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT ls_record AT lv_pipe INTO TABLE lt_field_tab.
CLEAR: lv_field_index, ls_input_data.
LOOP AT lt_field_tab INTO ls_field.
lv_field_index = lv_field_index + 1.
ASSIGN COMPONENT lv_field_index OF STRUCTURE
ls_input_data TO <fs_field>.
IF sy-subrc = 0.
<fs_field> = ls_field-field.
ENDIF.
ENDLOOP.
APPEND ls_input_data TO ft_input_data.
ENDIF.
ENDDO.
CLOSE DATASET fv_file_path. -
Is there an utilitity to extract data from a datapump file since impdp give
Hi,
meanwhile doing a reorganization, customer has exported a table of various GBytes with expdp and has dropped the table afterwards. The problem is that it recives an ORA-600 [klaprs_11] error related to corrupted file when executing impdp.
Customer now requires to recover so many rows as possible from the corrupted datapump export file. Is there any tool available to do this?.
Thanks.
Regards,
Alberto AragónPl post details of OS and database versions, along with the complete import command and the complete error message.
There is no way of extracting data from a datapump export file.
These MOS Docs may help
ORA-600 [Klaprs_11] On Impdp Using Dumpfile Exported with COMPRESSION=ALL (Doc ID 739849.1)
DATAPUMP IMPORT FAILS WITH ORA-39014, ORA-31672 AND ORA-600 [klaprs_11]/[klaprs_12]/[klaprs_14] ERRO (Doc ID 1082741.1)
Datapump Import Triggering ORA-00600 [klaprs_11] on Few Objects (Doc ID 743483.1)
Datapump Import impdp Fails With ORA-600 [klaprs_11] (Doc ID 1073547.1)
HTH
Srini -
BPC 7.5 will extract data from flat file or directly from cube
Hi,
i have a doubt plz give me a solution.
1) previously our BPC 7.0 team extracted data from BI 7.0 through flat file, but now they have upgraded to BPC 7.5 i want to know whether BPC 7.5 will extract directly from our BW infocube or not.
2) please let me know how data extracted from BPC 7.5.
Thanks and Regards
SatishHi,
If your import file has duplicate record in it then the Status of your DM package for import ends with warning, where all the records in your file might have got accepted but only one last data rows amoung the duplicate rows might have got submitted to the system.
The duplicate records will be rejected and you can see the list of duplicate records as well in the DM package status report.
Like Nilanjan said you can use Append DM Pacakge to submit all duplicate records aswell into the system. But here the problem is it appends the data in flat file with data available in the system.
Say you have 100 for account1 in the system and you run Append DM Package having values duplicate values for account1 say 100 and 200. So after the Append Package execution you will have 100100200= 400 for account1.
So for Append DM package to work in the same way as import, run clear package before executing the Append package.
Hope this helps,
Regards,
G.Vijaya Kumar -
Extract data from Essbase with HAL to a flat file
Hello,
I would like to extract data from Essbase with HAL.
I use the essbase Adapter with the "Extract Data" Method.
All is working when I use only the essbase Adaptater and configure it.
But I want to have a variable on my Years dimension.
I have to fill "Years member port" and "Years Criteria port" of my essbase Adapter with variable.
I have a "v_year" and "v_year_criteria" variable. I fill "v_year" with "FY05" but I don't know how fill my "v_year_criteria" variable.
Thanks a lor for answer.If you are in 9.3x, I would recommend using the DATAEXPORT calc script function. You just FIX on what you want to export (including substitution variables), and then fill in some parameters and it writes a file. Look in the DBAG.
-
Extract data from Query to a Flat File - scheduling in the background
Hi All,
We need to extract data from a query to a flat file periodically, but each time 10 separate executions based on 10 profit centers, to get the separate files.
So, we have PC1, PC2, ... PC10 Profit centeres.
We have Query1, with profit center variable.
We have created 10 variants for Query1 so that we can execute for 10 profit centers.
Now, we have used RSCRM_BAPI to execute the Query1 and write to a flat file. Now we are having a problem in getting this feature used to execute the query automatically for 10 different varaints.
Thanks in advance,
_ ShashiShashi,
You can try using Information Broadcasting or Reporting Agent. You can schedule this in Information Broadcasting.
check this link for Information Broadcasting... <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/a5/359840dfa5a160e10000000a1550b0/content.htm">http://help.sap.com/saphelp_nw04s/helpdata/en/a5/359840dfa5a160e10000000a1550b0/content.htm</a>
Nagesh Ganisetti. -
How to Extract Data from the PDF file to an internal table.
HI friends,
How can i Extract data from a PDF file to an internal table....
Thanks in Advance
ShankarShankar,
Have a look at these threads:-
extracting the data from pdf file to internal table in abap
Adobe Form (data extraction error)
Chintan -
How can I extract data from a sound file in carbon
hello,
I am a student and I start recently learning carbon. I have to do a application which can read and extract data from a sound file and use that data to do some kind of visual representation of the file. I would like to know if someone can give some directions, tutorial,some code sample etc.
thank you for your help
chenita7hello orangekay
My idea is to create an application that can read a sound file( AIFF, MP3 or other) in order to extract some kind of data ( numbers or any values) and use that data to represent the sound file visually.
I dont know which kind of data can be extract from a sound file, and in which way i can manipulate that data to became a visual representation of the sound file. this is what I want to do as my second assignment for a subject at school, introduction to programming. has to be done based in carbon.
regards
chenita7 -
How often in the real time projects extract data from flat files n process
I am going thru teh BODS data integrator, and trying to understand the demand of ETL services extract data from a flat file, is that really impt in teh real time jobs.
Thank you very much for the helpful info.Hi,
As per the inputs given by you guys i started loading data from flat file.
I try to load 28 files from i which i was able to load 24 files succesfully.For the other 4 i got this error messages
1) Error 'Enter period in the format __.YYYY...' at conversion exit CONVERSION_EXIT_PERI6_INPUT (field CALMONTH record 1, value DUMYTRA)
Message no. RSDS012
2) a) Error 'The argument '1,008.00' cannot be interpreted as anumber' on assignment field QUANT_B record 11714 value 1,008.00
Message no. RSDS013
b) Error 'The argument '1,110.00' cannot be interpreted as anumber' on assignment field QUANT_B record 15374 value 1,110.00
Message no. RSDS013
3) a) Error 'The argument '1,140.00' cannot be interpreted as anumber' on assignment field QUANT_B record 1647 value 1,140.00
Message no. RSDS013
b) Error 'The argument '2,028.00' cannot be interpreted as anumber' on assignment field QUANT_B record 4625 value 2,028.00
Message no. RSDS013
4) Error 'The argument '1,151.00' cannot be interpreted as anumber' on assignment field QUANT_B record 7808 value 1,151.00
Message no. RSDS013
I'am unable to trace out what is the error exactly.
I checked this values in files they are perfect.
can anybody please guide me on this issue.
With Regards,
Pradeep.B -
Extracting Data from Archived data files in R/3
Hi Experts,
I have a situation here!!!
I want to extract data from R/3 for BW. In R/3 system, data is present in archived files (which are not in readable format). In R/3 system, the report definitions are ABAP codes which give output. These ABAP codes uses same infostructure, archived files are also same, but the logic is different for every report. I am trying to modify these ABAP codes to get data in a format which can be loaded in BW, but then i have to make different cubes for different report outputs in BW.
Is there any way in which i can read the structure of these archived files so that i can design a single cube to store data of these files?Hi Arindam,
It is possible to extract archieved data from R/3. Following link contains the 'How to' guide for the same.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0ded994-c520-2a10-9da7-bc92c9e9882d
Hope this will be helpful. Thanks.
Sumit -
Hi,
I am trying to extract data from multiple CSV files to SQL into a single table. The data type of all the columns in SQL table is nvarchar(MAX). I am able to extract the data from the flat files but some of the data(on extraction) is
corrupt including question marks(?) and other invalid special characters. Also I tried selecting the UTF-8, 65001(Unicode) format but the problem still persists. Also I tried using data converter but no use.
I checked with the data in the flat file but there is no data with question mark(?) or any other special characters.
The separator in the flat file is Comma(,)
Please help.
Thanks in advace.The source system and application determines the code page and encoding. Is it Windows, Unix, Mainframe or some other type?
Unicode files sometimes begin with a byte order mark (2 bytes) to indicate little or big endian. If you open the file in notepad and then select save as, the encoding in the dialog will show the encoding notepad detected based on the BOM. If
that is ANSI instead of Unicode or UTF-8, you will need to know the code page the source system used when the file was created.
Dan Guzman, SQL Server MVP, http://www.dbdelta.com -
Hi,
I'm trying to extract data from a non-SAP datasource (flat file) to BW, I need to first convert the source file (txt) into the appropriate format to load to BW (CSV or ASCII). Currently, the txt file is not in a either format but more in a report kind of format. Is there any functionality in BW that I could utilize to convert the source file esaily in the format that BW can understand? Can I do this using transfer rules?
Thanks.Thanks. But on the text file, there's some other information that I don't need such as the header information and the data currently is in group level. Can I utilize BW without changing the format on the original source file?
Thanks.
Maybe you are looking for
-
ASUS Sonicmaster X102BA Win764bit - usb bugcode driver blue screen on sleep
Hello I recently downgraded to windows 64 bit and when the PC goes to sleep it comes back up, freezes for about 15 seconds and then reboots with the BSOD error. I noticed in device manage its missing 2 drivers (SM Bus Controller and Universal Serial
-
Unable to login to AppsLogin.jsp page.
Hi group, I have just completed a migration of the database from 32 bits to 64 bits in a Windows 2003 environment, after that I am trying to login to the Application, but I am unable to do that (Just a blanck page is displayed). F:\ORAEBS_APPS\inst\a
-
To what extent does auto-syncing work...?
I have researched this but can not find the answer anywhere. I need to know to what extent does auto-syncing work? I started my library quite some time ago, and I didn't want to use the auto-sync feature. My library has grown very large and to be hon
-
How to atomate caching options for all pages?
Hi, Customer request: Does there exist a means of automating caching option for all the pages of a page group or a portal? Thanks a lot for your kind help. Best regards. Jean-Francois
-
I am using 10.4.11. Trying to upgrade Itunes so I can set up our new IPad. However, to upgrade Itunes, I have to upgrade OS. Do I need to buy the full version of 10.5, or can I just purchase the upgrade? (about $100 difference). All this just to get