why convert 8 space to 1 tab character on unix?

Hi everybody,

I'm using Hp unix tru64.
I have generate one file from shell script.
bus that file content pre "8 space char" convert one tab character.

why?

result file hex format:
hex 20 20 20 20 20 to 09

i need CR/FL format file on unix.

How does the script look like and why do you need a dos/windows format in Unix?

Regards

  1. file1.sql content:
    SELECT LPAD('1234567890',50,' ')||text result
    FROM table1

  2. file2.sh content:
    sqlplus -s user/pass@db @/disk1/exe/file1.sql >result.txt

I execute file2.sh that generate result.txt file.
The result file all lines should be include before 40 space.
but didn't include 40 space char result file.
Only 5 tab char included in result file.

Are you trying to replace a tab char with 8 spaces in result.txt?

sed 's/\t/        /g' result.txt

If your sed version don't recognize the "\t" as a tab character you can type Ctrl-V and then a tab instead.
Redirect the output if you want the output in a file.

Regards

Ok(include 40 spaces) file hex format:
00000000h: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ;
00000010h: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ;
00000020h: 20 20 20 20 20 20 20 20 31 32 33 34 35 36 37 38 ; 12345678
00000030h: 39 30 0A ; 90.

My generated wrong format file(include 5 tab). hex format:
00000000h: 09 09 09 09 09 31 32 33 34 35 36 37 38 39 30 0D ; .....1234567890.
00000010h: 0A ; .

why converte just save to file that 20 20 20 20 20 characters to 09 chararcher on the Unix ?

thank you

this is working: sed 's/\t/ /g' result.txt > Okfile.txt