Delete first 2 rows of a file
Hi Experts,
In an interface i'm uploading a spread sheet data into the program's internal table. I dont want the first 2 rows of the spreadsheet in the internal table as they are just the headings.
plz advise me.
thank you.
venu
data: begin of itab occurs 0,
name1 type c,
name2 type c,
end of itab.
data: t_filedata like alsmex_tabline occurs 0 with header line.
start-of-selection.
clear itab.
refresh itab.
*---Upload Spreadsheet.
perform read_file using p_xlfile.
*---Process data into formatted internal table.
perform format_data.
form read_file using p_filename like rlgrap-filename.
*---Upload spreadsheet.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = p_filename
I_BEGIN_COL = 1
I_BEGIN_ROW = 1
I_END_COL = 256
I_END_ROW = 65536
TABLES
INTERN = t_filedata
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
IF t_filedata[] is initial.
message i009 with 'NO DATA FOUND IN FILE' p_filename.
stop.
ENDIF.
sort t_filedata by row col.
endform. "READ_FILE
form format_data.
data: l_index type i.
field-symbols: <fs1>.
loop at t_filedata.
can i write that like this, here?????????
1method:
<b>delete t_filedata index 1.
delete t_filedata index 2.</b>
2nd method:
or
<b>check sy-tabix > 2.</b>
l_index = t_filedata-col.
assign component l_index of structure t_sheet to <fs1>.
<fs1> = t_filedata-value.
at end of row.
append itab.
clear itab.
endat.
endloop.
refresh t_filedata.
free t_filedata.
endform. "FORMAT_DATA
Message was edited by: venu gopal
Similar Messages
-
Regarding ssis - Filter first 5 rows from flat file
Hi,
i have a requirement like this every day we receive 10-15 Flat files , we need to load these data into SQL Table ,here nothing is complex for this we need to use foreachloop Container,Dataflowtask..etc. here the issue is each flat file have top 5 rows has
Client information like ( We need to delete First 5 rows) and then insert into SQL Table . please suggest me how to develope the package..You need to use a script task to read file one by one and remove the first 5 rows from the file. The file name/path can be stored as a variable and read it from the script code. Insert the script task inside the foreach loop container just before importing
the file.
Refer the link to remove a line in .net
http://stackoverflow.com/questions/7008542/removing-the-first-line-of-a-text-file-in-c-sharp
Regards, RSingh -
Delete first empty row in a table
Hi,
Can you please provide the script for the below requirement.
Need to delete First empty row in all the tables. (Tables having more number of empty rows. i need to delete first empty row only)
Regards,
Velu@Velu – the following blog post by Jongware might get you started:
Tackling Tables through Scripting
by: Jongware | April 8, 2013
http://indesignsecrets.com/tackling-tables-through-scripting.php
Document Object (DOM) documentation:
Indesign JavaScript Help
InDesign ExtendScript API (10.0)
Table Row specifics:
Adobe InDesign CS6 (8.0) Object Model JS: Row
InDesign ExtendScript API (10.0)
Uwe -
How to delete internal table first 4 rows.
Hi All,
How can I delete First 4 rows from itab.
Thanks and regards
Vijayahi,
do 4 times
if itab[] is not initial.
DELETE itab INDEX 1.
endif.
enndo.
or
DELETE itab FROM idx1 TO idx2.
<b>Effect</b>
Deletes the range of lines from index idx1 to idx2 from the internal table itab. You can only use this variant with index tables (standard or sorted tables). You must specify at least one of the parameters FROM idx1 or TO idx2. If you omit the FROM parameter, the system deletes the lines from the start of the table to idx2. If you omit the TO parameter, the system deletes from line idx1 to the end of the table. The starting line idx1 must be greater than 0.
The Return Code is set as follows:
SY-SUBRC = 0:
At least one entry deleted.
SY-SUBRC = 4:
No entries deleted. -
Urgent - Deletion of duplicate rows in a table - Help me
Hi friends,
Here is my purchase_order_line table desc,
SQL> desc purchase_order_line;
Name Null? Type
PURCHASE_ORDER_LINE_ID NOT NULL NUMBER
DESTINATION_ID NOT NULL NUMBER
PURCHASE_ORDER_ID NOT NULL NUMBER
LINE_NO NOT NULL NUMBER
PART_NO VARCHAR2(10)
PART_DESC NOT NULL VARCHAR2(100)
ORDER_QTY NOT NULL NUMBER
ORDER_DATE NOT NULL DATE
DUE_DATE DATE
VERSION_NO NOT NULL NUMBER
VERSION_DATE NOT NULL DATE
purchase_order_line_id is a primary key.
If you ignore the primary key column temporarily,
for the rest of 2 to 11 columns, i have a duplicate data in this table.
I want to clear out all duplicates.
Suppose if I have 3 similar rows(exclude primarykey), then delete first two rows and leave the last one.
OR delete last two rows and leave the first one.
What is the best solution for this ?
thanks for help.
Sridharhere is some example that might be of help.
SQL> select case_number, case_status_desc status, case_ownr owner,
2 case_yr year, doc_id
3 from wrt_case
4 order by doc_id;
CASE_NUMBER STATUS OWNER YEAR DOC_ID
2006-786 ACTIVE E 2006 22072734
2006-786 ACTIVE E 2006 22072734
2006-786 ACTIVE E 2006 22081673
2006-786 ACTIVE E 2006 22081673
2006-786 ACTIVE E 2006 22143005
2006-786 ACTIVE E 2006 22143005
2006-786 ACTIVE E 2006 22243094
2006-786 ACTIVE E 2006 22243094
8 rows selected.
SQL> Select case_number, case_status_desc status, case_ownr owner,
2 case_yr year, doc_id, rowid,
3 row_number() over (partition by doc_id order by doc_id) as rn
4 From wrt_case;
CASE_NUMBER STATUS OWNER YEAR DOC_ID ROWID RN
2006-786 ACTIVE E 2006 22072734 AAD8bTAAJAAAJ4nAAA 1
2006-786 ACTIVE E 2006 22072734 AAD8bTAAJAAAJ4nAAC 2
2006-786 ACTIVE E 2006 22081673 AAD8bTAAJAAAJ4nAAB 1
2006-786 ACTIVE E 2006 22081673 AAD8bTAAJAAAJ4nAAD 2
2006-786 ACTIVE E 2006 22143005 AAD8bTAAJAAAJ4nAAE 1
2006-786 ACTIVE E 2006 22143005 AAD8bTAAJAAAJ4nAAF 2
2006-786 ACTIVE E 2006 22243094 AAD8bTAAJAAAJ4nAAG 1
2006-786 ACTIVE E 2006 22243094 AAD8bTAAJAAAJ4nAAH 2
8 rows selected.
SQL> Delete From wrt_case
2 Where rowid in (Select t.rid
3 From (Select case_number, case_status_desc status, case_ownr owner,
4 case_yr year, doc_id, rowid as rid,
5 row_number() over (partition by doc_id order by doc_id) as rn
6 From wrt_case) t
7 Where t.rn > 1);
4 rows deleted.
SQL> select case_number, case_status_desc status, case_ownr owner,
2 case_yr year, doc_id, rowid
3 from wrt_case
4 order by doc_id;
CASE_NUMBER STATUS OWNER YEAR DOC_ID ROWID
2006-786 ACTIVE E 2006 22072734 AAD8bTAAJAAAJ4nAAA
2006-786 ACTIVE E 2006 22081673 AAD8bTAAJAAAJ4nAAB
2006-786 ACTIVE E 2006 22143005 AAD8bTAAJAAAJ4nAAE
2006-786 ACTIVE E 2006 22243094 AAD8bTAAJAAAJ4nAAG
SQL> -
How to ignore the first row in sender file
I would like to ignore the first row in each file in the sender channel - how can i do it?
Hi
Check this,
As he said give Document Offset = 1
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
Also check this forum
Re: Supress Column Heading - File Content Conversion in Sender Adapter
Thanks,
Prakash -
Delete multiple rows from text file
HI,
i have a text file and i want to remove first few rows from that text file not last rows.
how can i do that ?
thanksbecause i suspect this is a homework assignment i'm not going to give you the fish, but i will teach you how to fish! =P
go investigate the Java Standard class called: BufferedReader. Look specifically at the method readLine()
combine that with a for loop, and an IF-THEN statement to weed out the lines you don't want (or just govern that with the FOR loop's index), and you should be able to figure it out....
good luck! give it a whirl... -
How to delete empty table row in the form using formcalc
Hi All,
I am displaying a table in PDF which has a few empty rows in between. I need to delete those specific rows when the form is generated, so that they do not appear on the form.
Has anyone worked on this before? If so, can you please share the code or advise.
Regards
AditiHello,
first: there MUST be same backend you get the data from right? So in this backend there is some data extraction coding, right? So the result of this coding is bad, like some unwanted extra rows are returned in the proper set of rows, right? So why don´t you change this backend coding not to return the unwanted rows?
IF that is not possible (I don´t believe this!), but just to describe other possibilities, you can place a script on the row subform event like initialize and test if there is something missing there and if so, set the presence of such a row to hidden.
JS: If (this.fieldA.rowValue == "") { this.presence = "hidden"; }
Regards, Otto -
Solved: Delete Using Automatic Row Processing
See Scott's reply below for the answer.
Hi there,
I have an application built in APEX 3.0.1 that I would like to be able to use a button to delete a single row from an underlying database table (owned by the parsing schema).
My APEX page has a 3 HTML regions on it:
1. Only a Select List and Go button for User selection (of Debit Note)
2. Ten display Items (Text Field, Disabled saves state) displaying further information about User selection
3. Conditional Delete button (region with custom image) - only displays when P73_DEBITNOTEID is NOT NULL
I'd like this button to be used to Delete the Selected Item and thought I'd be able to use a Data Manipulation Page Process - Automatic Row Processing (DML) page process to do this.
However, when I go through the wizard the Select item containing primary key column value field has no values in the search list.
My first question is why was there no values in the list?
So I manually entered the Item I required (P73_DEBITNOTEID) but when I run the page and click the button I get a PL/SQL missing expression error.
What is the best practice method to do DML actions on the underlying database tables. The tables are all owned by the parsing schema.
Your help in resolving this matter would be greatly appreciated.
Kind Regards,
Gary.Gary,
The DML processes (and the creation wizards for them) are for use with items having source type Database Column. If your page items don't use this source type, then neither the Automated Row Fetch nor the Automatic Row Processesing (DML) process types will work.
Scott -
Button to delete all empty rows
I am in the process of creating an interactive form that has a button that add rows for the user to input issues and another button to add follow-ups to those instances. There are 3 different sets of these. However, we do not want to add a delete button to all rows, to allow for accidental deletion of already inputted data. I would like to create a button that will delete all empty rows, including all subforms. Either that, or upon saving the document, all empty rows would be deleted - whichever would be easier. Please help! This seems like it will be a complicated task and I am not that well versed in LiveCycle to be able to figure this out on my own.
Thank you!There is no doubt that looping through nested repeating objects is more complex:
Here is the script for the first table with follow-up rows:
// Technical
var nCount3 = VitalsSubform.Technical._Instance1.count;
for (var k=0; k<nCount3; k++)
// this is script to remove the follow-up rows in the first table only
var nCount6 = xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1._Row1.count;
// loop through the rows in the follow-up table
for (var i=0; i<nCount6; i++)
if (xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "].Table1.Row1[" + i + "]").Cell4.rawValue == null)
// remove null row
xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1._Row1.removeInstance(i);
// recount nCount in case a row has been deleted
nCount6 =xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1._Row1.count;
// account for the row that is now deleted
i = i-1;
// now remove null statements
if (xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1.Statement.Statement.rawValue == null)
VitalsSubform.Technical._Instance1.removeInstance(k);
var nCount3 = VitalsSubform.Technical._Instance1.count;
k = k-1;
It is by no means tested and could still be flaky.
Have you considered a manual 'x'/delete button for the follow-up rows?
Here is the form: https://acrobat.com/#d=JMGUKXNQ*qMD18S3W5VxSQ
Niall -
How to ignore 1st row form the file(csv) sender CC
Hi,
I have a CSV File (File sender) that I need to load with PI.I want to Ignore 1st row from the file.
For example the File contains 10 rows but PI need to read the data from 2nd row.
because in the 1st row contains header data like name, number, mobile, address, etc., I don't want to read this 1st row. I want to read only the data which starts from the 2nd row.
can you pls tell me the ignore command File Receiver CC
I am using these commands.
Record structure: item,*
item.fieldSeparator: ,
item.endSeparator : 'nl'
item.fieldNames: Name, Number, Address, Mobile
Thanks in Adv
VankadoathHi Vankadoath,
In your content conversion use the field document offset which ignores the number of lines to be ignored.
for example if you provide the value as "1" for document offset it will ignore the first line in your file.
(Under Document Offset, specify the number of lines that are to be ignored at the beginning of the document.
This enables you to skip comment lines or column names during processing.
Regards,
Naveen. -
Hi all
i am designing the javacode which takes the name of the file and partitions it and places the filename and date in apropriate column in my database
it is successful
but when my code runs ,each time it brings the data again and again with the new data ,so i need to have the stored procedure which can concatenation the first two rows of my table and then compare and remove the duplicate rows
so heres my code
import java.sql.*;
import java.io.*;
public class SimpleJdbc1
public static void main(String[] args) throws SQLException,
ClassNotFoundException {
/*folder where all my files will be there,i need to take the file name which contains the filename_date in it ,so i partition it ,to get the file name and date separately*/
File f = new File("E:/Interface/OUT");
File files[] = f.listFiles();
for(int i=0;i<files.length;i++)
String str =files.getName();
System.out.println(str);
int len = str.length();
int value=len-13;
String str1 = str.substring(0,value);
String str2 =str.substring(value+1,len-4);
System.out.println("filename: " +str1);
System.out.println("date: " +str2);
// Load the JDBC Driver
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("Driver loaded");
//establish a connection
Connection conn =
DriverManager.getConnection("jdbc:oracle:thin:@host:1521:sid",
"username","password");
System.out.println("Database connected");
//create a statement
Statement sqlStatement= conn.createStatement();
//Execute a statement
sqlStatement.executeUpdate("INSERT INTO CLARITY.Z_INBOUND_AUTO_SCHEDULE(FILE_NAME, FILE_DATE, CREATED_DATE, MODIFIED_DATE, PROCESS_STATUS, ID)"
+ "VALUES('" + str1 + "','" + str2 + "', SYSDATE, SYSDATE, 0, z_inbound_auto_schedule_s1.nextval)");
conn.close();
System.out.print(i);
so please help me to solve the problem ,as i am not gud in stored procedure
thanku & regards
sreeramYou need to add a where clause to your insert statement so that you don't reinsert records:
sqlStatement.executeUpdate(
"INSERT INTO CLARITY.Z_INBOUND_AUTO_SCHEDULE(FILE_NAME, FILE_DATE, CREATED_DATE, MODIFIED_DATE, PROCESS_STATUS, ID)"
+ " VALUES ('" + str1 + "','" + str2 + "', SYSDATE, SYSDATE, 0, z_inbound_auto_schedule_s1.nextval)"
+ " WHERE NOT EXISTS (SELECT 1 FROM CLARITY.Z_INBOUND_AUTO_SCHEDULE"
+ " WHERE FILE_NAME = '" + str1 + "'"
+ " AND FILE_DATE = '" + str2 + "')"); -
Regarding ssis - skip first 10 rows in excel source
Hi,
I have received an Excel Source file, but the first 10 rows have only company information; actual data starts from Row 11. How will you skip the first 10 rows and start reading from row 11Hi Koteswararao,
If the first row includes the column names, and the first 10 rows you said don’t include the first row. That means you want to skip the rows from 2 row to 10 row, then we can union two Excel sources to work around this issue. For more details, please refer
to the following steps:
Set the FirstRowHasColumnName property of the Excel Connection Manager to False, so the first row stores the column names in the sheet.
Drag two Excel Sources to the Data Flow Task.
In the Excel Source, use the SQL command below to replace the former(supposing there are three columns in the Excel sheet: col1, col2 and col3):
SELECT F1 AS col1,F2 AS col2, F3 AS col3 FROM
[sheet$A1:C1]
In the Excel Source 1, please type the SQL command below (note that the ‘n’ means the number of rows in the sheet):
SELECT F1 AS col1,F2 AS col2, F3 AS col3 FROM
[sheet$A11:Cn]
Drag a Union All component to the same task, then union those two Excel Sources.
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Hi Experts ,
I am working on SSIS 2008.
I have Excel file as a Source .
Scenario: First 5 Rows contain some Headings which I dont need
My Actual Header Starts from 6th Row and then Data .
How should I used my Excel source to Take 6th Row as Header and Then Data .
NOTE ::
I receive file every Month .
Name of File is same Every Month
Number and Name of Coumns are Fix
Number of Records are not Fix every month
I tried using OpenRowset in Excel sourcei.e Revenue$A6:D6
A6 =MY FIRST COLUMN HEADER
D6= My LAST COULMN HEADER
Package Executed but No data Loaded in Destination SQL Table
Any Help ??Hi Rihan
I tried using OpenRowset in Excel sourcei.e Revenue$A6:D6
A6 =MY FIRST COLUMN HEADER
D6= My LAST COULMN HEADER
here change the d6 to d(total rows in excel sheet) i.e if if u have 100 rows (A5:D100)
Regards
bhimireddy -
I have three accounts set up in Thunderbird, two are unified and the third one isn't. I've looked through the setting in the tools-account settings for each of the three accounts but I cannot see anything that refers to unified folders. I have the view-folders button set to on.
I've seen a solution on your forums which reads:-
Help menu (Alt +H) > troubleshooting information Click the show folder button.
Close Thunderbird
open the mail folder open the smart mailboxes folder
Delete the inbox and inbox.msf files
Restart Thunderbird.
I don't understand why this solution should make all my inbox's unified, and I don't want to loose any emails.
Can anybody help please?
Response appreciated.Bonjour Crumbleey,
Excuse me, I don't understand your problem ... Can you describe it and tell me what you want to get ?
I have been using Thunderbirds for years now, I installed it in many PCs, I solved many problems using only the standard possibilities of Thunderbird, I never had any need to intervene in the emails files and folders.
If you want to delete an account which has its own set of folders, if you want to keep its emails, first move the emails in Local folders.
Pierre
Maybe you are looking for
-
Retrieving old column values from a after delete trigger dynamically
I have a single audit table for deletions and the table structure has the following columns 1: table_name 2: column_name 3: column_value I am writing a trigger on tables for which i want to have delete audits and i am dynamicaly retrieving the column
-
Hi I am trying to create a PL/SQL Webservice based on an Oracle package. It fails with "An expected error was encounted. Generation aborted." The exception stack trace is pasted below. Any help is appreciated. java.io.FileNotFoundException: D:\OraBPE
-
I'm on my first day with Snow Leopard and a brand new iMac. So far, so good. But I had this great little AppleScript droplet that I used all throughout Mac OS X 10.0 to 10.5 which allowed you to drop a jpeg file on it which was created in PhotoShop a
-
Adobe Reader XI causes Microsoft Laser Keyboard 6000 v2.0 to type only numbers
Adobe Reader XI causes Microsoft Laser Keyboard 6000 v2.0 to type only numbers - I triedAdobe Reader X and it works fine, checked Microsoft Laser Keyboard driver and it is also upto date - any idea how to fix this annoying problem - it works fine til
-
Store the out put of smartform in a directory which is created on app..Serv
Dear All, I want to store the out put of smartform in a directory which is created on application server.so that the user in future can directly print the output with out again executing the smartform..... regards, Sudheer.G