473,394 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Carriage return at the end of the text line.

1
Thanks in advance who will look at it.

I have been encountering an issue which I can’t find a way out of it.

What my pgm does:

It (java codes) reads oracle table data and creates flat text data files. Another part of the program distributes the extracted text files to unix systems.

Problem first occurred:
Opening those files in Unix box shows carriage return in the middle of the record as well as at the end of the record.

My tries:

To strip out the CR or LF from the middle of the record added a check in program like looking for \r or \n and replace with ' '. That worked fine. But what happens is, depending on the data loading in the database, although the data looks identical across the databases, I encounter CR/LFs. so to clean it forcefully I modified the table views.
For example... (Text_field,chr(13)||chr(10),' ').

Okay that helped me getting rid of the in field CR/LFs... but the thing at the end of the line... ^M in Unix, which is the carriage return still showing up.

Not finding a way to eliminate that.

It probably is happening because of the file transfer from windows to unix. I also tried transferring the files manually using FTP program and in ASCII mode and still seeing those. The weird part it, some files shows up with CRs at the end some don’t. That’s where I am puzzled.

Just looking for way to clean it like... “u know what...I don’t want any carriage return anywhere... remove!!!”... possible?

I know a line separator or line breaker can come at the end otherwise it can’t recognize the start of a new record but still why some files do have ^M and some don’t?
Oct 4 '07 #1
1 4156
Saii
145 Expert 100+
In unix the command to remove ^M is dos2unix <filename>.

Hope that helps!!!
Oct 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Lauren Quantrell | last post by:
I have created the following trigger: CREATE TRIGGER ON OutputTable FOR INSERT AS Declare @filename nvarchar(35) Declare @filecontents nvarchar(2000) Declare @strcmdshell varchar(150)
2
by: Karthik.S | last post by:
I have a text area in my webpage where i allow people to format their data in to multiple paragraphs. I store this data in the database and display it in a similar textarea to keep the formatting...
3
by: David N. | last post by:
Hi All, I spent too much time on trying to get the CrLf into a string, which contains embedded SQL statements that can be executed by the SQLClient.SqlCommand. Note that these SQL statements...
3
by: Dave Tichenor | last post by:
How do you create a new line in the mail message; i'm using asp.net. I try using - vbcrlf - chr(13) and chr(10) - Environment.NewLine But when i receive the email message it is concatenated...
2
by: sys | last post by:
I have a web method that returns a string. When I return a string that has a carriage return and line feed in it ("\r\n") on the client side I only receive a string including the line feed ("\n")....
4
by: Captain Frog | last post by:
Hi All, Could anyone tell or point me to the correct syntax for a carriage return and line feed? I've tried vocal in a fixed size array and all I get is a single line text box even though the...
11
by: TheRain | last post by:
Hi, I am trying to append a carriage return to my string using the string builder class, but when I do this the string ends up containing "13". I tried this multiple ways like so ...
4
by: whitej77777 | last post by:
I am trying to write a user defined function that will allow me to strip off the last carriage return and line feed from a text field. We have address fields stored in a text field for our ERP...
4
by: LOCAFO | last post by:
I am using vb.net and have a long string of text. When I use vbnewline or vbCrLf, for a carraige retun, I get a black square box in the SQL database table. I need the carriage return but I don't...
4
by: coolguyraj | last post by:
Hi. I have form that has a text box. I want insert unformatted text into the database. Even if the user gives an carriage return or New line feed in the database it should be stored as on single...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.