Line Terminator
The preference change for line terminator in the environmental settings doesn't seem to change the line terminator for table file exports (for example INSERT). I don't get separate lines when viewed by MS Notepad no matter which setting I use, there is a null string marker (small square). I was trying this since there seems to be an error in the export using the Clipboard. SQL Developert 1.1.1.25.14 using the included JDK.
What can I do to fix this?
Thanks!
-Jim
You're right, I just had a readable export and it seems to be the same where I choose LF or LF/CR or Platform Default for exporting to a file. The 1.1.1 version didn't put any line terminator in and you got either one or two null string markers ( the little square box character shows) and it line wrapped continously. Now I get line breaks but it doesn't vary. The export function inproved but did not allow changing the option.
The Export DDL (and Data) doesn't substitute in for the line terminator at all though and it shows the null string markers.
So it seems to be only partially fixed for file export.
Similar Messages
-
Setting Line Terminator for a CLOB column by script
Hello Everyone,
I have a CLOB column in my table that receives external data (more than 400 sources).
The GUI application displays it in different ways because of the multiple incoming Line Terminators.
Here is the weird thing:
In SQL developper 3.1.06. In the Preferences->Environment I selected as Line Terminator: Carriage Return and Line Fe(Windows)
Once I committed the changes the data was properly displayed in the application (apparently was also re-coded).
My Question is:
How can I setup this property on the column or table to fix the issue??
(I'm looking for a DDL script or something alike).
Thanks in advance.
Mijail O. T.914451 wrote:
If that's the case, What is the SQL DEveloper doing then??
I tested and looks like is a global parameter, not sure if works only for the table. (That what I need).
If is possible to setup this feature from the GUI it should be a way to do it running a Script.
Right????No.
Tables don't have any concept of "lines".
CLOB's don't have any concept of "lines".
"lines" only exist in the context of the data you are providing, but that's not of concern to the database.
So it looks like, what SQL Developer is doing (I assume as I don't use it), is to have a setting such that when it comes to display character data from VARCHAR2's or CLOB's it determines if there are CR/LF or just LF characters (as per the setting) and then uses those as line terminators for displaying the data in it's own interface. Thus it sounds like an interface specific setting, or to put it bluntly, it's something that is a part of SQL Developer to control how it displays things.
Have you tried querying back the raw version of the data from the database to see that it still has the CR/LF characters in it? It should.
I think you'll find the setting is a "display" setting, not a "alter my data" setting. -
Different line terminator for SocketChannel
Any ideas on how to specify a different line terminator than '\n' for the SocketChannel.read() method, such as ASCII character 127?
Ok..and here's a third answer....
Socket s= my_socket_channel.socket();
InputStreamReader isr = new InputStreamReader(s.getInputStream());
String a_line="";
boolean reading=true;
while (reading)
int c = isr.read();
if (c==-1) {if (!a_line.equals("")){process(a_line);}
reading=false;}
if (c==127){process(a_line); a_line="";}
else{
char cc = (char)c;
a_line=a_line+cc;
}How does that sound? -
Utl_file.putline - platform specific line termination character
PUT_LINE terminates the line with the platform-specific line terminator character or characters.
But the porblem is this.
The file generator application can run in different platform,and hence it means I can have different line termination character.Is there anyway I can force it to generate Unix only line termination character (line termination char in Unix I guess is \n) .
In short programatically I want to control it.
I looked at UTL_FILE.PUTLINE but it doesnt have any option to control the line termination char.
Help.here is the example, i am on HP UNIX
SQL> DECLARE
2 l_text VARCHAR2 (32767);
3 v_file UTL_FILE.FILE_TYPE;
4 BEGIN
5 -- OPEN FILE to write
6 v_file := UTL_FILE.FOPEN (LOCATION => 'NOTIFICATION',
7 filename => 'Test.txt',
8 open_mode => 'w',
9 max_linesize => 32767
10 );
11 UTL_FILE.PUT(v_file,'Hello' || CHR(10));
12
13 UTL_FILE.PUT(v_file,'how are you' || CHR(10));
14
15 UTL_FILE.PUT(v_file,'I am fine' || CHR(10));
16 UTL_FILE.FCLOSE (v_file);
17 ---- open file to read
18 v_file := UTL_FILE.FOPEN (LOCATION => 'NOTIFICATION',
19 filename => 'Test.txt',
20 open_mode => 'r'
21
22 );
23 BEGIN
24 LOOP
25 UTL_FILE.GET_LINE (v_file, l_text, 32767);
26 DBMS_OUTPUT.PUT_LINE (l_text);
27 END LOOP;
28 EXCEPTION
29 WHEN NO_DATA_FOUND
30 THEN
31 NULL;
32 END;
33 -- READ LAST LINE
34 -- DBMS_OUTPUT.PUT_LINE ('Last Line : |' || l_text || '|');
35 UTL_FILE.FCLOSE (v_file);
36 EXCEPTION
37 WHEN OTHERS
38 THEN
39 UTL_FILE.FCLOSE (v_file);
40 END;
41 /
Hello
how are you
I am fine
PL/SQL procedure successfully completed.
SQL> ed
Wrote file afiedt.buf
1 DECLARE
2 l_text VARCHAR2 (32767);
3 v_file UTL_FILE.FILE_TYPE;
4 BEGIN
5 -- OPEN FILE to write
6 v_file := UTL_FILE.FOPEN (LOCATION => 'NOTIFICATION',
7 filename => 'Test.txt',
8 open_mode => 'w',
9 max_linesize => 32767
10 );
11 UTL_FILE.PUT(v_file,'Hello');
12 UTL_FILE.PUT(v_file,'how are you' );
13 UTL_FILE.PUT(v_file,'I am fine' );
14 UTL_FILE.FCLOSE (v_file);
15 ---- open file to read
16 v_file := UTL_FILE.FOPEN (LOCATION => 'NOTIFICATION',
17 filename => 'Test.txt',
18 open_mode => 'r'
19 );
20 BEGIN
21 LOOP
22 UTL_FILE.GET_LINE (v_file, l_text, 32767);
23 DBMS_OUTPUT.PUT_LINE (l_text);
24 END LOOP;
25 EXCEPTION
26 WHEN NO_DATA_FOUND
27 THEN
28 NULL;
29 END;
30 -- READ LAST LINE
31 -- DBMS_OUTPUT.PUT_LINE ('Last Line : |' || l_text || '|');
32 UTL_FILE.FCLOSE (v_file);
33 EXCEPTION
34 WHEN OTHERS
35 THEN
36 UTL_FILE.FCLOSE (v_file);
37* END;
38 /
Hellohow are youI am fine
PL/SQL procedure successfully completed. -
Contract Lines terminated in error
Hi,
We have a bunch of contract lines that got wrongly terminated by a program. We need to un-terminate those. I can update the contract lines date_terminated to NULL using okc_contract_pub.update_contract_line API, and it works fine. But the Install Base and Service Request information still shows the contract as terminated for that Serial No. This is very urgent as our customers may be denied service if the warranty/contract shows terminated status.
Any help is appreciated.
TIA
Alka.Sorry, never mind. Figured out that I was not updating the sts_code....duh!
-
Access an objects method + no line terminator
Hi,
I've just found out that if you can use the objects methods by not terminating a line with semicolon;
StringBuffer sb = new StringBuffer();
sb.append("A")
.append("B")
.append("C");Is this because the terminator closes access to the object and its methods, so not placing a terminator allows a VB style with statement to just access the methods.
Why/How is this possible?
Is it good practice?
Any Help on this would be great,
CheersIt's because the append() method returns an instance of itself. I.e. it's implemented like this:
public StringBuffer append(String text) {
// ... do internal operations to add the string
return this;
}The semi-colon ends the statement. Since you haven't closed the statement, you have access to the l-value (the returned value from the method) and can invoke methods on the object that it references.
Is it good practice?It's sometimes useful, but it can be overused. -
Hello,
I use LIN with UDS with the Automotive Diagnostic Command Set.
After opening the diagnostics with "Open Diagnostic on LIN.vi", I call the "Diag Set Property.vi" with the property ID 15 (=Termination) and value 1. As soon as I write this property, independent of the value 1 or 0, I can't see any activity on the LIN. If I don't call this, the communication on LIN is working, but the termination is missing. If I connect an external termination, it is OK. But if there is this option, to connect the internal termination, it also should work...
Any idea?
MadottatiHey Madottati,
What is UDS?
Which hardware do you use?
Which driver/LabVIEW Version?
Could you please also post the VI, which you use?
Stephan -
In our situation, there are many numbers that can terminate into one user for many different reasons. I.E. A help line for product A, and a sales line for product B. Some users have up to 14 different numbers that they will be responsible for. It is a CCM 4.2 envorionment, with unity unified msg. The user needs to be able to differentiate between the called numbers. Aside from using multiple lines on a sidecar 7914, is there an alternate solution for changing the appearance of the called number? Would forwarded route points be able to pass calling and called line information via the 7960 screen?
Thank you.Yes, that will work. Take a look at the following post for the required steps.
http://forum.cisco.com/eforum/servlet/NetProf?page=netprof&forum=IP%20Communications%20and%20Video&topic=IP%20Telephony&CommCmd=MB%3Fcmd%3Dpass_through%26location%3Doutline%40%5E1%40%40.1ddb5957/0#selected_message
Hope this helps. If so, please rate the post.
Brandon -
Batch list import is picky about line terminations in the text file
After running into trouble trying to compose a batch list for import, I isolated the issue:
The text file that you attempt to import must have "carriage return" characters at the end of each line. It can have a "carriage return" and a "line feed", but it cannot have only a "line feed".
If you feed Final Cut a text file that does not meet this criteria, it will barf up this error message:
One or more items on the header line do not match valid Browser column headers.
Line terminators have been the cause of many a problem over the years! Typically, MSDOS/Windows systems tend to create text files that use a CR-LF combo. While Mac OS was typically just a CR. And UNIX systems have typically been just an LF. However, since Mac OS X is now a hybrid of older Mac ways, and UNIX ways, you can find mixed situations there. For example, the Mac OS X Text Edit program saves out files with just an LF, and thus can't be directly used to create batch lists for Final Cut.
So, you need to be careful what means you use to create batch list text files.
Hope this helps some poor soul some day!
-RickI am trying to export a batch list created in FCP 5.1 to someone with 6. I follow directions, export and save and then e-mail the file. When he tries to import it, he gets that message ("One or more items on the header line do not match valid Browser column headers"). But I have tried re-importing it from my desktop and have no problem. Is there a problem going with such simple data from 5.1 to 6? Is it possible that the e-mail transmission is corrupting the files?
Thanks for suggestions. -
Creating Users via Command Line/Terminal
Hey Everyone!
A Happy New Year to all! I hope that it was a good way to end your 2005 and I hope your 2006 looks to be promising!
Now back to the tough stuff.
Does anyone have a detailed example of how to create a user (user name, short name, password) assign them to a group(s), and set an expiration date for that account?
I'm guessing that there is a single string that could be entered into Terminal that would do all of this. I've read the man page for dscl but I honestly dont know how to interpret it as I'm not TOO fluent with Terminal yet. Yes I understand it can be dangerous to work inside Terminal which is why I'm asking for an assistance in translating the man page to englishdscl -u $ADMIN -P $PASSWORD /LDAPv3/127.0.0.1 -create /Users/$shortname
dscl -u $ADMIN -P $PASSWORD /LDAPv3/127.0.0.1 -create /Users/$shortname UniqueID $4
dscl -u $ADMIN -P $PASSWORD /LDAPv3/127.0.0.1 -create /Users/$shortname RealName $shortnam
PowerMac G4 1.25DP Mac OS X (10.4.1) -
Command Line Input Terminating with Ctrl+D
Hi,
I am writing a program, that gets the input from the command line, what I want the program to do it continue to get the input until Ctrl+D is entered but I can not work out how to do this.
Has anyone got any ideas.
Thanks,
AdamAre you working in a unix system? If so, Control-D means end-of-input, so you don't specifically look for a control-D character, you just check for end of input (end of the stream). This is provided in IO routines, in particular BufferedReader:
"Returns:
A String containing the contents of the line, not including any line-termination characters, or null if the end of the stream has been reached"
So for example:
import java.io.*;
public class test {
public static void main(String argv[]) {
String line;
int i = 0;
try {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
while((line = in.readLine()) != null) {
i++;
} catch (IOException e) {
e.printStackTrace();
System.out.println("Now I'm done, having read " + i + " lines."); -
Best way to remove last line-feed in text file
What is the best way to remove last line-feed in text file? (so that the last line of text is the last line, not a line-feed). The best I can come up with is: echo -n "$(cat file.txt)" > newfile.txt
(as echo -n will remove all trailing newline characters)What is the best way to remove last line-feed in text file? (so that the last line of text is the last line, not a line-feed). The best I can come up with is: echo -n "$(cat file.txt)" > newfile.txt
(as echo -n will remove all trailing newline characters)
According to my experiments, you have removed all line terminators from the file, and replaced those between lines with a space.
That is to say, you have turned a multi-line file into one long line with no line terminator.
If that is what you want, and your files are not very big, then your echo statement might be all you need.
If you need to deal with larger files, you could try using the 'tr' command, and something like
tr '
' ' ' <file.txt >newfile.txt
The only problem with this is, it will most likely give you a trailing space, as the last newline is going to be converted to a space. If that is not acceptable, then something else will have to be arranged.
However, if you really want to maintain a multi-line file, but remove just the very last line terminator, that gets a bit more complicated. This might work for you:
perl -ne '
chomp;
print "
" if $n++ != 0;
print;
' file.txt >newfile.txt
You can use cat -e to see which lines have newlines, and you should see that the last line does not have a newline, but all the others still do.
I guess if you really did mean to remove all newline characters and replace them with a space, except for the last line, then a modification of the above perl script would do that:
perl -ne '
chomp;
print " " if $n++ != 0;
print;
' file.txt >newfile.txt
Am I even close to understanding what you are asking for? -
How to go to a specific line # in java?
Hi,
I have located a keyword in a file using the bufferredreader class (by reading line by line and searching for the keyword).
This method returns the # of the line that contains the keyword. Say this method return 'n'. I need to pass this information to another method and have it skip the first 'n' lines and start reading from the (n+1)th line.
I have not found this capability in the Bufferredreader class nor other classes in Java that I looked at. Do you know of any filereader class that does that?
Note that my intent is to delete the line that contains this keyword. The way I am thinking of right now is to find the line, pass its line # to another method and have that method line (n)th with (n+1)th sequentially to the end of the file. Would you suggest a better way of approaching the problem all together?
Thanks,
parachuter2bbckrispi is right ! This is a small part of a pretty big server/client program that has to be platform independable as well.
mchan0 :
so this is not useful? rather then have the second program re-read, you >could output the rest of the file to a new file without the first n lines?
java.lang.Object
java.io.Reader
java.io.BufferedReader
readLine
public String readLine()
throws IOExceptionRead a line of text. A line is considered to be terminated >by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return >followed immediately by a linefeed.
Returns:
A String containing the contents of the line, not including any >line-termination characters, or null if the end of the stream has been >reached
Throws:
IOException - If an I/O error occursI need to delete only that one line from the file...so would need to retain the first n-1 lines and (n+1)th till the end of the file.
cotton.m:
Note that my intent is to delete the line that
contains this keyword.
This actually concerns me more than your current problem.Do you mean there's a better way of going about this problem or something else? sorry ! I don't quite get what you mean. -
SQL loader and stream files with new line '
I have been trying unsuccessfully to load EDI files using SQL loader. The problem
is that the lines are terminated by ' and when I use the stream file option it does
not recognise the line terminator given. As I understand it from the documentation
this should work - but it does not. I have also used the Hex option with no better
result. Does anyone have any ideas ?
I can and have used tr "[']" "[\n]" in Unix to convert the ' to newlines - I just
wonder am I missing something in SQL loader which will allow me to do this ?
This is the sql loader control file
LOAD DATA
INFILE 'WS860685.MFD' "Str ''' "
BADFILE 'WS860685.bad'
DISCARDFILE 'WS860685.dsc'
INTO TABLE "DUND1"."EDI_LOADED_TEMP"
REPLACE
FIELDS TERMINATED BY '+'
TRAILING NULLCOLS
(L1,
L2,
L3,
L4,
L5,
L6,
L7,
L8,
L9,
L10,
L11,
L12,
L13,
L14,
L15,
L16,
L17,
L18,
L19,
L20,
L21,
L22,
L23,
L24,
L25,
L26,
L27,
L28,
L29,
L30,
L31,
L32,
L33,
L34,
L35,
L36,
L37,
L38,
L39,
L40,
LNO)
Heres a sample of the data
UNB+UNOA:2+5398888501357+5398888501838+080306:0737+395+ DESADV+++1'UNH+0001+DESADV:D:93A:UN:EAN004'http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6020061915147
answers this question perfectly -
System Settings - Command Lines
Help !...
How can I modify System settings (Prefs Panes) via Command Lines/Terminal ?...http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/timed.8. html#//apple_ref/doc/man/8/timed
is this what are you looking for?
Maybe you are looking for
-
Firefox don't close when "browsing and Download History" is deleted on exit
Firefox doesn't close properly in about 50 % of cases. When closing FF, the window closes but the process firefox.exe isn't terminated. When trying to open FF again you got the error message "Firefox is already running, but not responding. To open a
-
How can a .mov be an "unsupported file type"?
I've saved a PowerPoint presentation as a .mov and it plays fine on its own (as a quicktime movie.) It also shows up as availabe file in my "movies" pane. However, when I try to drag it into a drop zone, I get the following error message: "Unsupporte
-
Cisco Codec C90 screen refresh/flicker
Hi guys, We are currently experiencing issues where we have a Cisco Codec C90 with two outputs to two screens (HDMI1 & 2) Every now and then (randomly) we will see a quick horizontal flick run up the screen similar to a refresh… This can some times h
-
so i bought 100,000 coins on the Plants vs Zombies game on the ipod touch and i did not get the coins i bought. however, they DID take my money! how can i get the coins or my money back?
-
Problem in java swing programming
Hello I am developing one project. I which i put one main menu from which user choose various options. One of the option is associating students with the batch. As user choose this option, it opens one frame in which user get one comobox containing l