How to extract a complete column from excel?
Hi there,
I have a excel file with some testing parameters, organized in rows. That means, in the first column are the serial numbers (type ID) of my "devices under test", and the respective parameters are located in the adjacent columns of the row.
I'd like to extract the first column as a whole with my LabVIEW application, search this column (1D array) for a particular number and use the "found"-index to read the rest of the row to get the parameters associated with this index/serial number.
How can I do this? Until now I always had to read a specific range e.g. "A1:E8" to get values out of an excel file. But as I don't know how many serial numbers are stored in the excel file, I don't know how to limit the range...?!
Does anybody have an idea how to solve this problem?
Regards
Achim
One workaround would be to create a user-defined function which searches for the first empy cell, something like:
Function FindLastCell()
Dim LastCell As Range
With ActiveSheet
Set LastCell = .Cells(.Rows.Count, "A").End(xlUp)
If IsEmpty(LastCell) Then
'do nothing
Else
Set LastCell = LastCell.Offset(1, 0)
End If
End With
FindLastCell = LastCell.Row
End FunctionInsert this function in your spreadsheet at a known location, then read the value. The value will indicated the number of rows that are populated before you hit the empty cell. You can edit the function for the appropriate column.
Message Edited by vt92 on 01-31-2008 08:14 AM
"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
Similar Messages
-
How to upload 3 more columns from excel to SAP with exiting BDC program
Dear ABAPers,
Three more columns are added to the existing excel sheet(new columns are Consignment DP, Consignment Value, Total Consignment Value).
Actual program is :The program is to upload the TXT data from MLM Solution
Transaction code syntax is in bdc prog: call transaction 'VF01' using bdcdata update 'S' mode 'N' messages into i_bill_return.
i am new to BDC concepts, please give me the complete details, how can i upload.
Thanks in advance.
HariHi Hari,
How is your input structure define, (data from excel to internal table). If you have the fields defined in it...
1.you need to change the input structure first in your program....
2. If your business needs any validation to these new fields????
3.you need to modify the BDC population code for the new fields and populate the BDC structure....
If the hint is useful Say thanks by reward .
Regards,
Prabhu Rajesh -
How to extract a single column from XML and load in Oracle
Hi
below I have a structure of xml files , I just need to extarct <RecordReference>PQPMID:7358</RecordReference>
from file and load in to oracle ..
Please let me know how to do ..??
file content below
HoldingsRecord>
<RecordReference>PQPMID:7358</RecordReference>
<NotificationType>00</NotificationType>
<SerialVersion>
<SerialVersionIdentifier>
<SerialVersionIDType>07</SerialVersionIDType>
<IDValue>1068624X</IDValue>
</SerialVersionIdentifier>
<SerialVersionIdentifier>
<SerialVersionIDType>01</SerialVersionIDType>
<IDTypeName>PMID</IDTypeName>
<IDValue>7358</IDValue>
</SerialVersionIdentifier>
<Title>
<TitleType>02</TitleType>
<TitleText>Pittsburgh Post - Gazette</TitleText>
</Title>
<Publisher>
<PublishingRole>01</PublishingRole>
<PublisherName>Post Gazette Publishing Company</PublisherName>
</Publisher>
<OnlinePackage>
<OnlineServiceName>ProQuest</OnlineServiceName>
<Website>
<WebsiteRole>03</WebsiteRole>
<WebsiteLink>http://proquest.umi.com/pqdweb</WebsiteLink>
</Website>
<HoldingsDetail>
<JournalIssue>
<JournalIssueRole>04</JournalIssueRole>
<JournalIssueDate>
<DateFormat>00</DateFormat>
<Date>19930118</Date>
</JournalIssueDate>
</JournalIssue>
<JournalIssue>
<JournalIssueRole>06</JournalIssueRole>
<JournalIssueDate>
<DateFormat>00</DateFormat>
<Date>20080915</Date>
</JournalIssueDate>
</JournalIssue>
<EpubFormat>10</EpubFormat>
</HoldingsDetail>
</OnlinePackage>
</SerialVersion>
</HoldingsRecord>My mistake - thought you're looking for a general idea. Here's the working example:
CREATE OR REPLACE PROCEDURE import_test (i_result_file IN XMLTYPE DEFAULT XMLTYPE(bfilename('XMLDIR','my_test.xml'),nls_charset_id('ALT32UTF8')))
IS
xml_rec XMLTYPE;
v_index PLS_INTEGER;
v_rec_ref VARCHAR2(30);
BEGIN
v_index := 1;
WHILE i_result_file.Existsnode('/rec/HoldingsRecord['||To_Char(v_index)||']') > 0
LOOP
BEGIN
--- Get the line
xml_rec := i_result_file.Extract('/rec/HoldingsRecord['||To_Char(v_index)||']');
CASE WHEN i_result_file.Existsnode('rec/HoldingsRecord['||To_Char(v_index)||']/RecordReference') > 0
THEN v_rec_ref := xml_rec.extract('HoldingsRecord/RecordReference/text()').getStringVal();
DBMS_OUTPUT.put_line('v_rec_ref: '||v_rec_ref);
END CASE;
EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.put_line('My Message: '||v_index||' '||SQLERRM);
END;
v_index := v_index + 1;
END LOOP;
END import_test;
and here is my_test.xml I have used:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<rec>
<HoldingsRecord>
<RecordReference>PQPMID:7358</RecordReference>
<NotificationType>00</NotificationType>
<SerialVersion>
<SerialVersionIdentifier>
<SerialVersionIDType>07</SerialVersionIDType>
<IDValue>1068624X</IDValue>
</SerialVersionIdentifier>
<SerialVersionIdentifier>
<SerialVersionIDType>01</SerialVersionIDType>
<IDTypeName>PMID</IDTypeName>
<IDValue>7358</IDValue>
</SerialVersionIdentifier>
<Title>
<TitleType>02</TitleType>
<TitleText>Pittsburgh Post - Gazette</TitleText>
</Title>
<Publisher>
<PublishingRole>01</PublishingRole>
<PublisherName>Post Gazette Publishing Company</PublisherName>
</Publisher>
<OnlinePackage>
<OnlineServiceName>ProQuest</OnlineServiceName>
<Website>
<WebsiteRole>03</WebsiteRole>
<WebsiteLink>http://proquest.umi.com/pqdweb</WebsiteLink>
</Website>
<HoldingsDetail>
<JournalIssue>
<JournalIssueRole>04</JournalIssueRole>
<JournalIssueDate>
<DateFormat>00</DateFormat>
<Date>19930118</Date>
</JournalIssueDate>
</JournalIssue>
<JournalIssue>
<JournalIssueRole>06</JournalIssueRole>
<JournalIssueDate>
<DateFormat>00</DateFormat>
<Date>20080915</Date>
</JournalIssueDate>
</JournalIssue>
<EpubFormat>10</EpubFormat>
</HoldingsDetail>
</OnlinePackage>
</SerialVersion>
</HoldingsRecord>
<HoldingsRecord>
<RecordReference>PQPMID:9875</RecordReference>
<NotificationType>00</NotificationType>
<SerialVersion>
<SerialVersionIdentifier>
<SerialVersionIDType>07</SerialVersionIDType>
<IDValue>1068624X</IDValue>
</SerialVersionIdentifier>
<SerialVersionIdentifier>
<SerialVersionIDType>01</SerialVersionIDType>
<IDTypeName>PMID</IDTypeName>
<IDValue>7358</IDValue>
</SerialVersionIdentifier>
<Title>
<TitleType>02</TitleType>
<TitleText>Pittsburgh Post - Gazette</TitleText>
</Title>
<Publisher>
<PublishingRole>01</PublishingRole>
<PublisherName>Post Gazette Publishing Company</PublisherName>
</Publisher>
<OnlinePackage>
<OnlineServiceName>ProQuest</OnlineServiceName>
<Website>
<WebsiteRole>03</WebsiteRole>
<WebsiteLink>http://proquest.umi.com/pqdweb</WebsiteLink>
</Website>
<HoldingsDetail>
<JournalIssue>
<JournalIssueRole>04</JournalIssueRole>
<JournalIssueDate>
<DateFormat>00</DateFormat>
<Date>19930118</Date>
</JournalIssueDate>
</JournalIssue>
<JournalIssue>
<JournalIssueRole>06</JournalIssueRole>
<JournalIssueDate>
<DateFormat>00</DateFormat>
<Date>20080915</Date>
</JournalIssueDate>
</JournalIssue>
<EpubFormat>10</EpubFormat>
</HoldingsDetail>
</OnlinePackage>
</SerialVersion>
</HoldingsRecord>
</rec> -
How to hide/remove a column from Excel download file
All,
I have about 7 columns iam displaying on my IR but there is 1 column on this report i dont want to appear on excel download file. How do i accomplish this?
apex 4.1.0/theme20/report region,
thanks in advance,Hello,
For IR, each download format is associated with specific REQUEST value. For CSV files, its CSV. So you can put the condition for columns using :REQUEST value as follows.
Goto Report Attributes -> Select Column you want to hide for CSV export -> Conditional Display
Condition Type- PL/SQL
Expression1- :REQUEST IS NULL OR :REQUEST != 'CSV'
Regards,
Hari -
How to read only particualr columns from excel sheet to internal table
Hi,
I have and excel sheet which has around 20 columns, in which i want to read only 6 columns. They are at different column positions, means the 1st column, 6thcolumn, 8th column so on..
Can we do this in sap? do we have any FM to do this?
Thanks.
Praveena.hi,
Use the below logic to fetch the data into internal table..You need to read the data cell by cell and update the internal table,
DATA l_count TYPE sy-tabix.
CONSTANTS: lc_begin_col TYPE i VALUE '1',
lc_begin_row TYPE i VALUE '2',
lc_end_col TYPE i VALUE '2',
lc_end_row TYPE i VALUE '3000'.
CLEAR p_i_excel_data. REFRESH p_i_excel_data.
* Function module to read excel file and convert it into internal table
CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
EXPORTING
filename = p_p_file
i_begin_col = lc_begin_col
i_begin_row = lc_begin_row
i_end_col = lc_end_col
i_end_row = lc_end_row
TABLES
intern = i_data
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
* Error in file upload
IF sy-subrc NE 0 .
MESSAGE text-006 TYPE 'E'.
EXIT.
ENDIF.
IF i_data[] IS INITIAL .
MESSAGE text-007 TYPE 'E'.
EXIT.
ELSE.
SORT i_data BY row col .
* Loop to fill data in Internal Table
LOOP AT i_data .
MOVE i_data-col TO l_count .
ASSIGN COMPONENT l_count OF STRUCTURE p_i_excel_data TO <fs_source> .
MOVE i_data-value TO <fs_source> .
AT END OF row .
* Append data into internal table
APPEND p_i_excel_data.
CLEAR p_i_excel_data.
ENDAT .
ENDLOOP .
ENDIF . -
How to extract audit log data from every document library in site collection using powershell?
Hi All,
I have n number of document library in one site collection,
My query is- How to extract audit log data from every document library in a site collection using powershell?
Please give solution as soon as possible?Hi inguru,
For SharePoint audit log data, These data combine together in site collection. So there is no easy way to extract audit log data for document library.
As a workaround, you can export the site collection audit log data to a CSV file using PowerShell Command, then you can filter the document library audit log data in Excel.
More information:
SharePoint 2007 \ 2010 – PowerShell script to get SharePoint audit information:
http://sharepointhivehints.wordpress.com/2014/04/30/sharepoint-2007-2010-powershell-script-to-get-sharepoint-audit-information/
Best Regards
Zhengyu Guo
TechNet Community Support -
How to extract master data attribute from r/3 to bw give steps details
how to extract master data attribute from r/3 to bw give steps details screenshots
Hi
Go through the below process to extract Master Data Attribute from R/3
Hi,
Maintaining Generic DataSources
Use
Regardless of the application, you can create and maintain generic DataSources for transaction data, master data attributes or texts from any transparent table, database view or SAP Query InfoSet, or using a function module. This allows you to extract data generically.
Procedure
Creating Generic DataSources
1. Select the DataSource type and specify a technical name.
2. Choose Create.
The screen for creating a generic DataSource appears.
3. Choose the application component to which you want to assign the DataSource.
4. Enter the descriptive texts. You can choose any text.
5. Select the datasets from which you want to fill the generic DataSource.
a. Choose Extraction from View if you want to extract data from a transparent table or a database view. Enter the name of the table or the database view.
After you generate the DataSource, you have a DataSource with an extraction structure that corresponds to the database view or transparent table.
For more information about creating and maintaining database views and tables, see the ABAP Dictionary Documentation.
b. Choose Extraction from Query if you want to use a SAP Query InfoSet as the data source. Select the required InfoSet from the InfoSet catalog.
Notes on Extraction Using SAP Query
After you generate the DataSource, you have a DataSource with an extraction structure that corresponds to the InfoSet.
For more information about maintaining the InfoSet, see the System Administration documentation.
c. Choose Extraction Using FM if you want to extract data using a function module. Enter the function module and extraction structure.
The data must be transferred by the function module in an interface table E_T_DATA.
Interface Description and Extraction Process
For information about the function library, see the ABAP Workbench: Tools documentation.
d. With texts you also have the option of extracting from fixed values for domains.
6. Maintain the settings for delta transfer, as required.
7. Choose Save.
When performing extraction, note SAP Query: Assigning to a User Group.
Note when extracting from a transparent table or view:
If the extraction structure contains a key figure field that references a unit of measure or a currency unit field, this unit field has to be included in the same extraction structure as the key figure field.
A screen appears on which you can edit the fields of the extraction structure.
8. Edit the DataSource:
○ Selection
When you schedule a data request in the BI scheduler, you can enter the selection criteria for the data transfer. For example, you can determine that data requests are only to apply to data from the previous month.
If you set the Selection indicator for a field within the extraction structure, the data for this field is transferred in correspondence with the selection criteria in the scheduler.
○ Hide field
You set this indicator to exclude an extraction structure field from the data transfer. The field is no longer available in BI when you set the transfer rules or generate the transfer structure.
○ Inversion
Reverse postings are possible for customer-defined key figures. Therefore inversion is only active for certain transaction data DataSources. These include DataSources that have a field that is marked as an inversion field, for example, the update mode field in DataSource 0FI_AP_3. If this field has a value, the data records are interpreted as reverse records in BI.
If you want to carry out a reverse posting for a customer-defined field (key figure), set the Inversion indicator. The value of the key figure is transferred to BI in inverted form (multiplied by 1).
○ Field only known in exit
You can enhance data by extending the extraction structure for a DataSource by adding fields in append structures.
The Field Only Known in Exit indicator is set for the fields of an append structure; by default these fields are not passed to the extractor from the field list and selection table.
Deselect the Field Only Known in Exit indicator to enable the Service API to pass on the append structure field to the extractor together with the fields of the delivered extract structures in the field list and in the selection table.
9. Choose DataSource ® Generate.
The DataSource is saved in the source system.
Maintaining Generic DataSources
● Change DataSource
To change a generic DataSource, in the initial screen of DataSource maintenance, enter the name of the DataSource and choose Change.
You can change the assignment of a DataSource to an application component or change the texts of a DataSource. Double-click on the name of the table, view, InfoSet or extraction structure to get to the appropriate maintenance screen. Here you make the changes to add new fields. You can also completely swap transparent tables and database views, though this is not possible with InfoSets. Return to DataSource maintenance and choose Create. The screen for editing a DataSource appears. To save the DataSource in the SAP source system, choose DataSource ® Generate.
If you want to test extraction in the source system independently of a BI system, choose DataSource ® Test Extraction.
● Delta DataSource
On the Change Generic DataSource screen, you can delete any DataSources that are no longer relevant. If you are extracting data from an InfoSet, delete the corresponding query. If you want to delete a DataSource, make sure it is not connected to a BI system.
NR -
How to Create a new column from two different result sets
How to Create a new column from two different result sets, both the result set uses the different date dimensions.
i got solutions for this is apply filters in column formula it self, based on the requirement.
-
I have had my old Iphone 5s replaced with a new one but I would like to know how to extract my old contacts from the iTunes backup? Please explain in basic english i am a beginner
Hey,
I think you will find that you have to have a debit/credit card stored on yur account regardless of whether your have iTunes Credit or want to purchase a free App. I don't know why, I assume its for ID verification or is part of the terms and conditions. I occasionally have to re-verify my credit card info even when just trying to run Update on one of my Apps or like I said downloading a free App.
If you need further clarification all you can do is contact iTunes Support:
https://expresslane.apple.com/ServiceOptionAction.action
Hope this helps. Andrew -
How do i read complete line from a text file in j2me?????
how do i read complete line from a text file in j2me????? I wanna read file line by line not char by char..Even i tried with readUTF of datainputstream to read word by word but i got UTFDataFormatException.. Please solve my problem.. Thanks in advance..
That is not my problem . i already read it char by char.. i am getting complete line..But this process is taking to much time..So thats why i directly wanna read complete line or word to save time..
-
How to upload the invocie verify from excel file?
How to upload the invocie verify from excel file?
there is more items requied to input.
refer to MIR7
thanksHow to upload the invocie verify from excel file?
there is more items requied to input.
refer to MIR7
thanks -
How-to extract data in chunks from one R3 to another R3 system
Does anybody know how to extract data in chunks from one system to another? Imagine you would like to extract 1M records in chunks of 10K records, how would you do it between 2 different R3 systems? A cursor (even with hold) doesn't work
Any suggestion appreciated
Thanks
IoanHi Ioan,
I'd do it with fm : TABLE_ENTRIES_GET_VIA_RFC (with where clause-tab)
or fm GET_TABLE_RFC (get all items)
regards Andreas -
How to Extract data and reports from the SAP BW warehouse
Hi to All Guru's
I am new to SAP BW. Can any one help me to know, How to Extract data and reports from SAP BW. Do we use any tools. After Extracting the data from SAP BW how can we move all the data to Cognos. It would be kind enough to provide me with any documentation or links. Step by step procedure would be very much helpfull to me.
Thanks
VenuHi Voodi
Thanks for the quick response. I think Open hub is to extract the data from SAP BW, but what about sending this data into Cognos. Can you please let me know in detail regarding answer. If possible send me any documentation or links regarding this. Thanks for your concern.
Venu -
How do i print to pdf from excel? I am using Windows 8.1 and Office 365 (new)
How do i print to pdf from excel? I am using Windows 8.1 and Office 365 (new)
Please see Huge lag in games on bootcamp as a reference. The linked thread is for a GT750m.
Since there are no mid-2013 Retina models (as per Apple - Support - Technical Specifications), assuming this is your Mac - MacBook Pro (Retina, 15-inch, Late 2013) - Technical Specifications - the same should work for you. -
How do I delete Completed items from the Completed Reminders List? The list is growing too long.
The little box, next to the reminder on the reminder page. Touch it, and it puts a check mark there, i suppose to mean completed. Leave the app. When you go back, the items are gone. ( at least on mine...)
Maybe you are looking for
-
Why do I get following reply from iTunes Store when I attempt to publish my podcast: "We had difficulty reading this feed. Host parameter is null." ? This is my podcast website: http://www.einarpetterson.org/Ars_et_Medicina/Podcast/Podcast.html I hav
-
Problems syncing and lots of "Other" data
I have a 32gb iPod Touch 5th gen running iOS 7. I have 2 major issues, as stated in the title. The first is with syncing. As iTunes goes through the steps it gets stuck on "Waiting for items to copy" or "Waiting for changes to be applied;" whichever
-
What is it with the new India Unlimited Plan?
Today when i was checking the subscriptions to India i found that there is a new plan called India Unlimited for 19.99 USD/month. I want to know more about this plan. When i checked it in the list of unlimited world countries... India is not listed t
-
Importing a field into an RTF file does not fill in Text To Display
This problem comes and goes. When I import a field from the local XML file into an RTF template, sometimes the Text to Display is blank, and I see five small circles in the cell. Other times, the Text to Display properly shows the field name. Is ther
-
Bad connection using Skype on Ipad and IMac
I have skype on my imac and on my ipad. I am trying to skype someone who is using my ipad in Spain. last night we spoke easily and it was very clear. Tonight it is really bad, with what seems to be a lot of interference and also breaking up. Using Wi