Hi Team,

I have a source files in unix as below.

1111111111111111----------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-----------------------------------------------------------!20000UNKNOWN ACCOUNT

Here - (dash) represents the null value.

The problem with this file is a record is 540 characters long which is divided into multiple line, 80 characters each.

I want to first replace null with space till 8 characters, no matter where the NULL value is. It could be at beginning (ex last line) or at end (first line) or at the middle of the line.

Once replaced, i want to read line by line and count the characters. Once the count reaches 540, it should CONCAT all characters and redirect to new file.

For example, in above case, the first record starts at 1... till ! AT 7TH line. And second record starts at 200... from 7th line till 540 characters.

I have tried using UNIX shell script, but could not able to replace NULL with space. I have heard that it is possible using java script.

If anyone can help me... highly appreciate. (I am not java person, working on Oracle DB).

Thanks,
Amit