Tab separated columns in sqlldr
How do i load a file with columns separated by tab. Some people say mention FIELDS TERMINATED BY '\t' and some say FIELDS TERMINATED BY X'9'. Which is correct and what is the difference between the two.
Oracle version 10.2.
Please give suggestions. Thanks.
The Oracle Server Utilities Manual would tell which one is correct,
Please do not ask questions for which you can find the answer yourself at http://tahiti.oracle.com easily.
Sybrand Bakker
Senior Oracle DBA
Similar Messages
-
Table as tab separated columns in a file using Java
I want to design a general java procedure which will take a oracle table name as input and will store the fields of table separated by tabs in a file.
For this i need to have access to field names of tables as i have to store them as headings.
How to get field names as strings?
I know that this can better be created by using file package of oracle and writing a PL/SQL procedure, but it will store it on oracle server machine and i want the file to be on client.
Any suggestions?
-SameerIn addition to having the data in the Oracle data dictionary, if you're writing a Java program you'll presumably be using JDBC which has a variety of MetaData classes that expose this sort of information.
If you're looking for speed, you might also search asktom.oracle.com for "SQL Unloader" which is a Pro*C program Tom Kyte wrote for this sort of thing.
Justin -
Tab Separated file for Sales Order creation
Hi,
I am creating a Z Report which intern calls BAPI BAPI_SALESORDER_CREATEFROMDAT2 for creating Sales Orders.
Sales Order details I am giving through Tab Separated File which contains all details like
1) Header Details
2) Partner Details
3) Item Details.
Can any one tell what is the process to convert this file to into Internal Table.....This Example is only for three column. If there are more column you can check
"LOOP AT intern.
IF intern-col = *. " * is coulmn number
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = filename
i_begin_col = 1
i_begin_row = 1
i_end_col = 3
i_end_row = 65000
TABLES
intern = intern
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT intern.
IF intern-col = '1'.
l_length = strlen( intern-value ).
IF l_length > 10.
l_flag = 'E'.
wa_error-vbeln = intern-value.
wa_error-message = 'Invalid Sales Order'.
CONTINUE.
ELSE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = intern-value
IMPORTING
output = wa_vbeln-vbeln.
CONTINUE.
ENDIF.
ELSEIF intern-col = '2'.
IF l_flag = 'E'.
wa_error-posnr = intern-value.
ELSE.
CLEAR : l_length.
l_length = strlen( intern-value ).
IF l_length > 6.
wa_error-vbeln = wa_vbeln-vbeln.
wa_error-posnr = intern-value.
wa_error-message = 'Invalid item Number'.
l_flag = 'E'.
ELSE.
wa_vbeln-posnr = intern-value.
APPEND wa_vbeln TO i_vbeln.
CLEAR : intern,wa_vbeln,l_flag,l_length.
ENDIF.
ENDIF.
ELSEIF intern-col = '3'.
CLEAR : wa_noti.
wa_noti-aufnr = intern-value.
APPEND wa_noti TO i_noti.
CLEAR : wa_noti.
ENDIF.
ENDLOOP. -
Store table data in a tab separated file in oracle apex
How to store table data in a tab separated file in oracle apex ?
Suppose i have a table 'Table1' as shown below.
id name
1 x
2 y
I want to get the result 'select * from table1;' into a tab separated file in oracle apex.For client you could
- invoke call to Oracle Reports, where an .rdf is ready to generate one for you
- utilise download as csv option in interactive reports
- call page that generates csv using htp package (CSV Download without Header, possible?
- modify an interactive report to do a similar thing (http://www.talkapex.com/2009/04/custom-download-for-apex-interactive.html) -
TAB SEPARATED instead of COMMA SEPARATED
Hi everybody,
I need to generate a Comma Separated File with reports 9i. As I read here on OTN I defined Destination Format as DELIMITEDDATA and I tried DELIMITED. In the first try, report builder crashed instantly and in the latter try, report builder creates a TAB SEPARATED file.
When I open (import) this file to Excell, the data are put in one cell in a rather unreadable form.
Does anyone have an idea how to get the result in a REAL COMMA SEPARATED FILE???
Thanx
HansUse the parameter DELIMITER=',' .
I think it works
Ashok -
Hi All,
I am facing a problem at the time of receiver file adapter(tab separated). I have given in the fieldSeparated as '0x09' but it takes '#' in the file. please help me if any body knows.
Regards
Govinda.Hi,
Still I am not getting Tab separated file. Please anybody help on the.
I have given:
Record.fieldSeparator ---> 'nl'
Row.fieldSeparator -
> '0x09' and tried copy the tab in the notepad and passte it.
Row.endSeparator -
>'nl'
But i am getting the # separated file. Plz let me know if any thing wrong in that and do i have to give any parameters.
Thanx
Govinda. -
How to set when press Tab in column matrix, then it will show a list
Hi
I want to my form exactly as Sales order, so when I press Tab in item No (on sales order) column it will show list of item
So I want to create my own form with matrix, and in the first column I want to set Tab event, so when I press Tab in that column it will shown list of something from database.
how to get an event Tab in column matrix ??
and what object in the list of item form (on sales order) ?? matrix or grid or something else ??
ThanksHi,
Linking a ChooseFromList to the matrix column should give you what you want. Samples of using the ChooseFromList can be found in the SDK HelpCenter and here in the SDN forum. For example:
choosefromlist in the fields of a matrix
Kind Regards,
Owen
P.S. Please note, you have posted this question in the general SAP Business One forum. Your question is more about development so I would recommend you post in the SAP Business One SDK forum rather than here. -
Read values from Tab Separated File(tsv) or Comma Separtated File (csv)
Hi All,
Am creating a portal application to dynamically display data in a tree structure .
I'm having some data's stored in a tab separated file . I need to retrieve these data and display it in a jsp fie. Can any help me regarding this.?
Regards,
EbenHi,
see whether this code helps:
==========================================================
public class Read_TabFile {
/** Creates a new instance of Read_TabFile */
public Read_TabFile() {
private static int c;
public static void main(String aa[])//pass ur file name here
File readThis=new File(aa[0]);
int count=0;
try
FileReader input=new FileReader(readThis);
Reader reader=new BufferedReader(input);
while(c!=-1)
if(c!=9&&c!=0&&c!=10&& c!=13)// for line feed,null,tab and comma
System.out.println(c);//populate ur bean here 4m which u r //setting values 4 the tree
count++;
c=reader.read();
System.out.println("EOF"+count);
}catch(FileNotFoundException nof){System.out.println("FileNotFoundException");/do smthng/}
catch(IOException iox){System.out.println("IOException")/do smthng/;}
=========================================================
If this doesnot satisfy ur need then let me know xactly what u r lookin 4...........
Abhi -
Import data from tsv (tab separated values) file
I have a large tab separated values file that I want to import into an oracle table so I can a) run queries on this data and b) split into smaller and more manageable files.
I'm very new to Oracle. I have installed 10g XE and sql_developer.
This tsv file has 3,684,011 rows. Maybe it could be imported into an Access DB then into Oracle, but that seems like extra work??I have a text.tsv file (Google calls it a csv, but
that's their error) which I feel I should be able to
just drop onto AW and have it open in a spreadsheet.
All I get is a couple of odd characters in the A1
cell.
Try dropping the file onto an open AppleWorks word processor document. If it is indeed a tab delimited text file, with no internal formatting information, you should then be able to copy it and paste into a spreadsheet.
Your comment regarding "a couple of odd characters in the A1 cell" indicates to me that there's more than simply text, tabs and returns in the file. If that's the case, you should be able to see the extra (often odd) characters in the WP document. If so, toggle 'Show invisibles' to on by pressing command-; (semi colon), then copy only the relevant text, tabs (will show as a right pointing arrow) and returns (will show as a reversed L haped arrow pointing left), and paste that block into your spreadsheet.
Regards,
Barry -
Problem in Uploading Data using a Tab Separated File?
Hi All,
I am trying to upload a file which tab separated containing customer and bank details and my file structure somewhat in the following manner.
10 21169 abcde xyz kdHDHLk gdh ghgah (Customer Details)
20 21169 DE 20050000 01122334 (bank details for customer 21169)
20 21169 DE 23022200 1122334455
(bank details for customer 21169)
20 21169 DE 23984899 223344556 (bank details).
But when I am trying to intial upload the details to an internal table using GUI_upload FM and display to check if it is loading correctly or not it is not giving me any o/p.
I am copying the code which I am trying to execute. Please tell me what way I need to modify the code so that it executes correctly.
parameters: p_file type rlgrap-filename.
data: begin of wa_file,
text(256) type c,
end of wa_file.
data: it_file like table of wa_file.
types: begin of ty_kna1,
kunnr type kunnr,
name1 type name1,
sortl type sortl,
stras type stras,
ort01 type ort01,
land1 type land1,
spras type spras,
end of ty_kna1.
data: it_kna1 type standard table of ty_kna1,
wa_kna1 type ty_kna1.
types: begin of ty_knbk,
kunnr type kunnr,
banks type knbk-banks,
bankl type knbk-bankl,
bankn type knbk-bankn,
end of ty_knbk.
data: it_knbk type standard table of ty_knbk,
wa_knbk type ty_knbk.
data: v_id(2).
At Selection-Screen on Value-Request for p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
* FIELD_NAME = ' '
IMPORTING
FILE_NAME = p_file
Start-of-Selection.
data: p_file1 type string.
p_file1 = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = p_file1
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
DATA_TAB = it_file
* EXCEPTIONS
* FILE_OPEN_ERROR = 1
* FILE_READ_ERROR = 2
* NO_BATCH = 3
* GUI_REFUSE_FILETRANSFER = 4
* INVALID_TYPE = 5
* NO_AUTHORITY = 6
* UNKNOWN_ERROR = 7
* BAD_DATA_FORMAT = 8
* HEADER_NOT_ALLOWED = 9
* SEPARATOR_NOT_ALLOWED = 10
* HEADER_TOO_LONG = 11
* UNKNOWN_DP_ERROR = 12
* ACCESS_DENIED = 13
* DP_OUT_OF_MEMORY = 14
* DISK_FULL = 15
* DP_TIMEOUT = 16
* OTHERS = 17
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
constants: c_tab type X value '09'.
loop at it_file into wa_file.
if wa_file+0(2) = '10'.
split wa_file at 'c_tab'
into v_id
wa_kna1-kunnr
wa_kna1-name1
wa_kna1-sortl
wa_kna1-stras
wa_kna1-ort01
wa_kna1-land1
wa_kna1-spras.
append wa_kna1 to it_kna1.
elseif wa_file+0(2) = '20'.
split wa_file at 'c_tab'
into v_id
wa_knbk-kunnr
wa_knbk-banks
wa_knbk-bankl
wa_knbk-bankn.
append wa_knbk to it_knbk.
endif.
endloop.
write:/ 'Customer Master General Data'.
uline.
loop at it_kna1 into wa_kna1.
write:/ wa_kna1-kunnr,
wa_kna1-name1,
wa_kna1-sortl,
wa_kna1-stras,
wa_kna1-ort01,
wa_kna1-land1,
wa_kna1-spras.
endloop.
clear wa_kna1.
skip 2.
write:/ 'Customer Master Bank Data'.
uline.
loop at it_knbk into wa_knbk.
write:/ wa_knbk-kunnr,
wa_knbk-banks,
wa_knbk-bankl,
wa_knbk-bankn.
endloop.
clear wa_knbk.
Regards,
MDDeclare Class cl_abap_char_utilities
Use File type as 'DBF'
Has_field_seperator = w_tab in FM GUI_UPLOAD
DATA: w_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = w_file
filetype = 'DBF'
append = ' '
write_field_separator = w_tab
TABLES
data_tab = it_extractchar
fieldnames = it_header
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
OTHERS = 22 -
Read text file (ASCII), tab separated
how to read contens of text file (ASCII), tab separated in a report.
hi kailash,
To read contents of text files (Ascii) use GUI_UPLOAD function.
GUI_UPLOAD - this FM will Upload the Data of a text File to ITAB.
Please see below the code for it.It is very simple ,plz go through it.
In the code when u call the function GUI_UPLOAD just mention the file type as 'ASCII' as done below.
pls do reward if useful.
Thanks.
types: begin of ttab,
f1(25) type c,
f2(10) type c,
f3(10) type c,
end of ttab.
data: itab type table of ttab with header line.
data: file_str type string.
parameters: p_file type localfile.
at selection-screen on value-request for p_file.
call function 'KD_GET_FILENAME_ON_F4'
EXPORTING
static = 'X'
CHANGING
file_name = p_file.
start-of-selection.
file_str = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = file_str
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = itab
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
*IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
Loop at itab.
write : / itab-f1,itab-f2,itab-f3.
endloop. -
Is it possible to save a Photoshop project with multiple tabs (inducing images) for later use. Now, when I close Photoshop, it ask to save each tab separately and they are not staying in the project for later usage. Thanks in advance for you help.
You should ask in Photoshop General Discussion
The Cloud forum is not about using individual programs
The Cloud forum is about the Cloud as a delivery & install process
If you will start at the Forums Index https://forums.adobe.com/welcome
You will be able to select a forum for the specific Adobe product(s) you use
Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll -
Create text file (ASCII), tab separated and load in sap (transaction al11)
hi..
i need to create a text file (ASCII), tab separated in sap which can be viewed in transaction AL11.
thank you.Hi kailashl,
Do intend to create a tab delimited file through program. or is it that you wish to diretly place the file on the application server.
PS: if you wish to place the file which you have on the application server from presentation you use the tcode CG3Z, you need to give the source file path on the front end and target path on the application.
If you wish to write the file onto the app server using program that you can do using dataset. and for tab delimited u can use CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
PS: Award points ONLY if the solution was useful to you. -
Hello,
I've an open hub to export to flat file. Is it possible to use a tab in the separator parameter?
I'd like to have the exported data in diferent cells in my excel sheet. It should be enough with comma but all data appear in the same cell in the CSV.
Can anybody help me?
Thanks in advance.
Regards.Hi,
While exporting, On the Destination tab page, select the required destination and in the separator option give ( ; ) instead of ( , )
try this .I hope you will get your columns in diffrent cells in the excel sheet.
please refere to the link also.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/501f0425-350f-2d10-bfba-a2280f288c59?QuickLink=index&overridelayout=true
Regards,
Sidhartha -
Hi,
This might be a really dumb one to ask but I am currently working on a table that has sequential data for steps that an invoice goes through in a particular system. Here is how it looks:
ID InvoiceID
InvoiceSteps
Timestamp
283403 0000210121_0002_2013
Post FI Invoice
2013-07-01 19:07:00.0000000
389871 0000210121_0002_2013
Clear Invoice
2013-08-25 14:02:00.0000000
Here is my extremely slow query that converts multiple rows of an invoice into a single one with 'InvoiceSteps' listed according to their timestamps in a sequential manner separated by commas.
SELECT [InvoiceID],
[InvoiceSteps] = STUFF((
SELECT ',' + ma.InvoiceSteps
FROM invoices ma
WHERE m.InvoiceID = ma.InvoiceID
ORDER BY [Timestamp]
FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'), 1, 1, '')
FROM invoices m
GROUP BY InvoiceID
ORDER BY InvoiceID;
Here is the end result:
InvoiceID InvoiceSteps
0000210121_0002_2013
Post FI Invoice,Clear Invoice
My question: How can I improve the query so that it can process thousands of records as fast as possible (>600K in this case).
Thanks you!There are many methods to concatenate the rows to columns. Assuming you have necessary indexes to support your query as Rishabh suggested, if you still find issues with performance, then you need to look at various other approaches as well. I have seen at
certain places(huge data), CLR outperformed . Having said, we need to assess each and come to a conclusion for your scenario.
Refer the below link for various approach, (please also look at the comment session as well):
https://www.simple-talk.com/sql/t-sql-programming/concatenating-row-values-in-transact-sql/
Maybe you are looking for
-
I can't restore my system to its factory condition.
hello all i have Pavilion DV6 laptop, my HardDisk is dmaged and i can't boot anymore (because of the physical BadSectors) , so ibought a new HardDisk ( 1TB ) when i plug my old hard disk into another PC , i can see the 3 partion's 1 : C:\[system] 2 :
-
ITunes 6.0.1: "Found New Hardware: iPodService"
I posted this yesterday in the "Upgrading, etc." forum, but have not received any responses or help; I thought it might be more visible in this forum. Since I posted, I did find a few posts that I thought would help, and I tried the suggestions, with
-
Changes to Normal.dotm in Word 2007
Hello, I have created a new "Blank Template.dotm" which essentially is a blank document that prompts users to enter in document properties, etc. The template works fine in Word 2007 (Office 2007 SP3). The requirement is to make this document the norm
-
I have user that just updated iTunes to the latest version. Now whenever he syncs with his laptop, his EAS will stop syncing. He can go back in and setup the account again and it will work until he syncs. Then it stops.
-
How to deactivate PSE 8 when Editor keeps crashing?
The Editor suddenly started crashing. I am attempting to deactivate PSE8 before uninstalling and reinstalling it I inderstand from previous threads in this forum that deactivation is done through the Editor Help. Since I can't reach the Editor, what