How to eliminate ^L

Hi,

I am trying to create a text file from data retrieved from a query.The data retrieved is having this character '^L' at regular intervals of the data.

How can i eliminate this, Please find below the sample data.

I tried sed -e "s/\^L//g" to convert it, but with no luck

^LCODESERIAL
^L341
37616
-
-
-
^L225*4103

Please help

try this

tr -d '\14' <infile >outfile

14 is the octal value of ctrl+L

Thank you for your response

I tried the 'tr' command but that did not work, no change in the data

can you attach your input file ?

Hi ,

U can try this method ,
open the file using vi <filename>
and then type the following command in escape mode
:s/ctrl v shift l//g
ctrl v shift l will print the ^L and all occurrences will be removed . :o:o

Please find attached the input file i am using.

mann2719,

Thank you for your response

i am trying this in the script and the converted file am sending as inout to another script.

can you please suggest any option that i can use it in script.

It works fine with the tr command. What have you tried , how did you execute the command.

$ tr -d '14' < test_file_1.txt > test_file_2.txt

tried as above...but after the command execution, there is no change between the files i am still seeing the ^L

you missed a slash, it is

tr -d '\14' <infile >outfile

Use in the script like this :
sed 's/ctrl v shift L//' filename

Kumaran,

That worked, the slash thing worked. Thanks a lot :b:

mann,

The sed also worked, i was actually using shift 6 to get that cap, that was the problem.Thank you. :b:

In the meantime i was digging around the query and found that the wild character is the FormFeed of Oracle as i have been using SET PAGESIZE 0, removing this has got me the file without the ^L.

Thanks a lot guys. this is my frist thread and it is a great experience learning this way. :slight_smile: