Skip to main content

[archive] Line Feeds in text fields

  • September 10, 2007
  • 7 replies
  • 0 views

[Migrated content. Thread originally posted on 07 September 2007]

We have a GUI that we've developed using AcuBench. In one of the fields we allow users to enter free text. This text gets written into the database for later retrieval and display when necessary. This has been working fine without any problems.

However, now we need to port the data to an Oracle Database from our ancient Allbase database. The problem is that when we build the flat files to port over to Oracle the line feed characters are playing havoc with our process. When the line sequential output is written the line feeds get written with it.

I've tried using sed's on the data after it's created and COBOL inspect/replace commands to try to replace the line feeds before the records are created. But eventhough I can replace the line feeds, the data to the right of the line feeds shows up in the flat file on a separate line - as if the line feed was still there.

Data typed in like this:
Hi. My name is Jeff. I am a
computer programmer

Gets stored in the database as one field like this:
Hi. My name is Jeff. I am a ^M computer programmer

But gets written to the line sequential output file as 2 records like this:
Hi. My name is Jeff. I am a
computer programmer

If I run a sed against the file I can get rid of the line feeds but I can't concatenate the lines back together.

Has anyone solved this problem before?

Thanks,
John

7 replies

[Migrated content. Thread originally posted on 07 September 2007]

We have a GUI that we've developed using AcuBench. In one of the fields we allow users to enter free text. This text gets written into the database for later retrieval and display when necessary. This has been working fine without any problems.

However, now we need to port the data to an Oracle Database from our ancient Allbase database. The problem is that when we build the flat files to port over to Oracle the line feed characters are playing havoc with our process. When the line sequential output is written the line feeds get written with it.

I've tried using sed's on the data after it's created and COBOL inspect/replace commands to try to replace the line feeds before the records are created. But eventhough I can replace the line feeds, the data to the right of the line feeds shows up in the flat file on a separate line - as if the line feed was still there.

Data typed in like this:
Hi. My name is Jeff. I am a
computer programmer

Gets stored in the database as one field like this:
Hi. My name is Jeff. I am a ^M computer programmer

But gets written to the line sequential output file as 2 records like this:
Hi. My name is Jeff. I am a
computer programmer

If I run a sed against the file I can get rid of the line feeds but I can't concatenate the lines back together.

Has anyone solved this problem before?

Thanks,
John
You might want to consider that there is probably both line feeds (ascii 10) and carriage returns (ascii 13). I presume your problem is that you only handle one of them. If this is the case, remove both and I would expect you to be okay.

[Migrated content. Thread originally posted on 07 September 2007]

We have a GUI that we've developed using AcuBench. In one of the fields we allow users to enter free text. This text gets written into the database for later retrieval and display when necessary. This has been working fine without any problems.

However, now we need to port the data to an Oracle Database from our ancient Allbase database. The problem is that when we build the flat files to port over to Oracle the line feed characters are playing havoc with our process. When the line sequential output is written the line feeds get written with it.

I've tried using sed's on the data after it's created and COBOL inspect/replace commands to try to replace the line feeds before the records are created. But eventhough I can replace the line feeds, the data to the right of the line feeds shows up in the flat file on a separate line - as if the line feed was still there.

Data typed in like this:
Hi. My name is Jeff. I am a
computer programmer

Gets stored in the database as one field like this:
Hi. My name is Jeff. I am a ^M computer programmer

But gets written to the line sequential output file as 2 records like this:
Hi. My name is Jeff. I am a
computer programmer

If I run a sed against the file I can get rid of the line feeds but I can't concatenate the lines back together.

Has anyone solved this problem before?

Thanks,
John
You might want to consider that there is probably both line feeds (ascii 10) and carriage returns (ascii 13). I presume your problem is that you only handle one of them. If this is the case, remove both and I would expect you to be okay.

[Migrated content. Thread originally posted on 07 September 2007]

We have a GUI that we've developed using AcuBench. In one of the fields we allow users to enter free text. This text gets written into the database for later retrieval and display when necessary. This has been working fine without any problems.

However, now we need to port the data to an Oracle Database from our ancient Allbase database. The problem is that when we build the flat files to port over to Oracle the line feed characters are playing havoc with our process. When the line sequential output is written the line feeds get written with it.

I've tried using sed's on the data after it's created and COBOL inspect/replace commands to try to replace the line feeds before the records are created. But eventhough I can replace the line feeds, the data to the right of the line feeds shows up in the flat file on a separate line - as if the line feed was still there.

Data typed in like this:
Hi. My name is Jeff. I am a
computer programmer

Gets stored in the database as one field like this:
Hi. My name is Jeff. I am a ^M computer programmer

But gets written to the line sequential output file as 2 records like this:
Hi. My name is Jeff. I am a
computer programmer

If I run a sed against the file I can get rid of the line feeds but I can't concatenate the lines back together.

Has anyone solved this problem before?

Thanks,
John
You might want to consider that there is probably both line feeds (ascii 10) and carriage returns (ascii 13). I presume your problem is that you only handle one of them. If this is the case, remove both and I would expect you to be okay.

[Migrated content. Thread originally posted on 07 September 2007]

We have a GUI that we've developed using AcuBench. In one of the fields we allow users to enter free text. This text gets written into the database for later retrieval and display when necessary. This has been working fine without any problems.

However, now we need to port the data to an Oracle Database from our ancient Allbase database. The problem is that when we build the flat files to port over to Oracle the line feed characters are playing havoc with our process. When the line sequential output is written the line feeds get written with it.

I've tried using sed's on the data after it's created and COBOL inspect/replace commands to try to replace the line feeds before the records are created. But eventhough I can replace the line feeds, the data to the right of the line feeds shows up in the flat file on a separate line - as if the line feed was still there.

Data typed in like this:
Hi. My name is Jeff. I am a
computer programmer

Gets stored in the database as one field like this:
Hi. My name is Jeff. I am a ^M computer programmer

But gets written to the line sequential output file as 2 records like this:
Hi. My name is Jeff. I am a
computer programmer

If I run a sed against the file I can get rid of the line feeds but I can't concatenate the lines back together.

Has anyone solved this problem before?

Thanks,
John
First I'd like to say that I'm glad you're still here Gisle. You are a huge asset for all of us.

I did strip the carriage return and line feed and still had a problem. Then I looked at the data in HEX and noticed that there was a carriage return before and after every line feed. When I accounted for that fact I solved the problem.

Your assessment was correct Gisle. Thanks.

[Migrated content. Thread originally posted on 07 September 2007]

We have a GUI that we've developed using AcuBench. In one of the fields we allow users to enter free text. This text gets written into the database for later retrieval and display when necessary. This has been working fine without any problems.

However, now we need to port the data to an Oracle Database from our ancient Allbase database. The problem is that when we build the flat files to port over to Oracle the line feed characters are playing havoc with our process. When the line sequential output is written the line feeds get written with it.

I've tried using sed's on the data after it's created and COBOL inspect/replace commands to try to replace the line feeds before the records are created. But eventhough I can replace the line feeds, the data to the right of the line feeds shows up in the flat file on a separate line - as if the line feed was still there.

Data typed in like this:
Hi. My name is Jeff. I am a
computer programmer

Gets stored in the database as one field like this:
Hi. My name is Jeff. I am a ^M computer programmer

But gets written to the line sequential output file as 2 records like this:
Hi. My name is Jeff. I am a
computer programmer

If I run a sed against the file I can get rid of the line feeds but I can't concatenate the lines back together.

Has anyone solved this problem before?

Thanks,
John
First I'd like to say that I'm glad you're still here Gisle. You are a huge asset for all of us.

I did strip the carriage return and line feed and still had a problem. Then I looked at the data in HEX and noticed that there was a carriage return before and after every line feed. When I accounted for that fact I solved the problem.

Your assessment was correct Gisle. Thanks.

[Migrated content. Thread originally posted on 07 September 2007]

We have a GUI that we've developed using AcuBench. In one of the fields we allow users to enter free text. This text gets written into the database for later retrieval and display when necessary. This has been working fine without any problems.

However, now we need to port the data to an Oracle Database from our ancient Allbase database. The problem is that when we build the flat files to port over to Oracle the line feed characters are playing havoc with our process. When the line sequential output is written the line feeds get written with it.

I've tried using sed's on the data after it's created and COBOL inspect/replace commands to try to replace the line feeds before the records are created. But eventhough I can replace the line feeds, the data to the right of the line feeds shows up in the flat file on a separate line - as if the line feed was still there.

Data typed in like this:
Hi. My name is Jeff. I am a
computer programmer

Gets stored in the database as one field like this:
Hi. My name is Jeff. I am a ^M computer programmer

But gets written to the line sequential output file as 2 records like this:
Hi. My name is Jeff. I am a
computer programmer

If I run a sed against the file I can get rid of the line feeds but I can't concatenate the lines back together.

Has anyone solved this problem before?

Thanks,
John
Happy to hear your problem is resolved John. :-)

[Migrated content. Thread originally posted on 07 September 2007]

We have a GUI that we've developed using AcuBench. In one of the fields we allow users to enter free text. This text gets written into the database for later retrieval and display when necessary. This has been working fine without any problems.

However, now we need to port the data to an Oracle Database from our ancient Allbase database. The problem is that when we build the flat files to port over to Oracle the line feed characters are playing havoc with our process. When the line sequential output is written the line feeds get written with it.

I've tried using sed's on the data after it's created and COBOL inspect/replace commands to try to replace the line feeds before the records are created. But eventhough I can replace the line feeds, the data to the right of the line feeds shows up in the flat file on a separate line - as if the line feed was still there.

Data typed in like this:
Hi. My name is Jeff. I am a
computer programmer

Gets stored in the database as one field like this:
Hi. My name is Jeff. I am a ^M computer programmer

But gets written to the line sequential output file as 2 records like this:
Hi. My name is Jeff. I am a
computer programmer

If I run a sed against the file I can get rid of the line feeds but I can't concatenate the lines back together.

Has anyone solved this problem before?

Thanks,
John
Happy to hear your problem is resolved John. :-)