🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Reading a PCH file

User: "Vikas Kumar_22189"
Altair Community Member
Updated by Vikas Kumar_22189

Dear all,

 

Is there any way to read PCH file and write into .xlsx File.

VBA code will be helpful.

 

If I am opening .pch file with notepad it is opening in single line but if i am opening .pch file in Notepad++ it is opening correctely.

 

I am looking for writting .pch file data in excel file.

Is it possible.

 

Thanks,

Vikas 

Find more posts tagged with

Sort by:
1 - 5 of 51
    User: "tinh"
    Altair Community Member
    Updated by tinh

    Maybe, open the file by Notepad++ and then replace spaces by commas?

    User: "Vikas Kumar_22189"
    Altair Community Member
    OP
    Updated by Vikas Kumar_22189

    Nope i have to do using TCl\Tk but the thing is PCH file is behaving differently while opening in notepad as well as using code.

     

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Maybe it is utf-8 encoding. using 'fconfigure' to set encoding before read/write to it

    User: "Vikas Kumar_22189"
    Altair Community Member
    OP
    Updated by Vikas Kumar_22189

    Dear @tinh

     

    Yes i have done that also I am not able to read data only.

    My code is:

     

    set pchFile [open C:/Users/ABC/Desktop/JJJ/Smallpch.pch 'r']
    set dataPCHFile [read $pchFile]
    puts 'dataPCHFIle: $dataPCHFile'
    close $dataPCHFile

     

    I have attached my punch file. Please try to read it by using TCL\TK code.

     

    Regards,

    Vikas kumar

     

    Unable to find an attachment - read this blog

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Hi

    add red line:

    set pchFile [open C:/Users/ABC/Desktop/JJJ/Smallpch.pch 'r']

    fconfigure $pchFile -encoding utf-8
    set dataPCHFile [read $pchFile]
    puts 'dataPCHFIle: $dataPCHFile'
    close $dataPCHFile