Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Replacing range of blanks in a file with ';' while leaving the single blanks between titles and data values alone using Regex

rjsosiFeb 14 2023

Hi,

We're using Linux and I have a fixed width file where the fields are separated by blanks.

Since I don't have the values of the fixed widths I want to change the blanks to ‘;’.

The problem is some of the fields headers and values have a space between them.

I'm able to use REXEP to change the blanks between the fields to ‘;’ but the blanks between the field headers and values change as well.

So my question is, how can I write a regular expression that replaces all the blank spaces between the fields with a ‘;’

or better yet a ‘ ; ' while leaving the blanks between the words of a file header and its values alone?

Comments
Post Details
Added on Feb 14 2023
1 comment
143 views