TXT file delimiter - Tab

Scripts Diversos para o Oracle SQL*Plus. (Relacionado a ferramenta Oracle SQL*Plus, para questões de SQL, usar o forum SQL)
Post Reply
MPires
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 3
Joined: Mon, 31 Jan 2011 4:18 pm
Location: Rio de Janeiro - RJ

I need to generate a TXT file from a BAT. I did everything correct, the file is being generated as wanted, but the delimiter enters the columns is appearing with 3x space and I need this separation to be done through tab because the program that will import this file is so programmed.
User avatar
dr_gori
Moderador
Moderador
Posts: 5024
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

You can use this command to place a delimiter:
See: [[0]

Select all

set head off feed off colsep ","
Example:

Select all

SQL> set head off feed off colsep "," 
SQL> / 
 
000000011B2DD400,      2727,      7468,   2841833,000000011DF131D8,       173,APPS 
000000011B2DE8B0,      2728,     38454,   3021490,000000011DF04C90,       173,APPS 
000000011B2E1210,      2730,     21099,   2874078,000000011DF26630,       173,APPS 
000000011B2E3B70,      2732,     13627,   2841909,000000011DF083E8,       173,APPS 
000000011B2E64D0,      2734,      2180,   3020465,000000011DF323F0,       173,APPS 
SQL> 

99] One thing I tested in Windows and Linux:

Select all

set colsep '<aqui eu teclei um tab>'
In Windows SQL * Plus, blank spaces appeared.
In Linux SQL * Plus, it was perfect! Delimited by Tab!

See what I did:

Select all

SQL> spool /home/applmgr/tes.txt 
SQL> set colsep '       '      <=== ESSE MONTE DE ESPAÇOS É UM TAB 
SQL>  select sid, serial# from v$session where rownum <5; 
 
       SID         SERIAL# 
----------      ---------- 
      2727            7468 
      2728           38454 
      2730           21099 
      2732           13627 
 
SQL> spool off; 
SQL> 
Linux Rocks! :-O
MPires
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 3
Joined: Mon, 31 Jan 2011 4:18 pm
Location: Rio de Janeiro - RJ

DR_GORI

worked a lot thanks, now I have to find out because the collector is importing the file ... Oh hard day!
MPires
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 3
Joined: Mon, 31 Jan 2011 4:18 pm
Location: Rio de Janeiro - RJ




is now working 100% I had to limit the size of the first field because it took 13 characters to import and the field was 15.
Thanks!!!
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests