Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: batch file to convert text file into excel  (Read 7073 times)

0 Members and 1 Guest are viewing this topic.

ryb

    Topic Starter


    Newbie

    • Experience: Experienced
    • OS: Windows 7
    batch file to convert text file into excel
    « on: February 01, 2017, 05:08:29 AM »
    Hello Guys,
    Very new to this forum
    I need to have a batch file program  which converts text file into Excel format
    as an example the contents will have 3 lines as below:
    1|0|32|1|1|2|0|0|1|0|0|2222|0|0|0|0|20170130151125|20170130151210|
    2|0|32|1|1|2|1|1|1|2222|1000|2222|0|0||0|20170130151125|20170130151210|
    10000|0|32|1|1|2|NULL|0|0|0|0|0|0|0|0|0|20170130151125|20170130151210|

    the 2nd line needs to be address importantly for further processing.




    Thanks
    Rajesh

    strollin



      Adviser
    • Thanked: 84
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Guru
    • OS: Windows 10
    Re: batch file to convert text file into excel
    « Reply #1 on: February 01, 2017, 07:18:17 AM »
    If I understand your question correctly, you don't need any form of batch file.  You can use the Data import function of Excel to import the data.  You will need to setup the delimiter as the '|' character since it is used in your text file to separate the data values.

    What version of Excel are you using?

    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: batch file to convert text file into excel
    « Reply #2 on: February 01, 2017, 07:24:09 AM »
    Batch files cannot read or write excel files.  If you need to read or write excel files then use  Vbscript, Jscript or Powershell.

    soybean



      Genius
    • The first soybean ever to learn the computer.
    • Thanked: 469
    • Computer: Specs
    • Experience: Experienced
    • OS: Windows 10
    Re: batch file to convert text file into excel
    « Reply #3 on: February 01, 2017, 08:39:53 AM »
    Batch files cannot read or write excel files.  If you need to read or write excel files then use  Vbscript, Jscript or Powershell.
    Your logic is backward.  He does not need a batch file to read or write Excel files.  He needs to know how to import data into Excel. 

    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: batch file to convert text file into excel
    « Reply #4 on: February 01, 2017, 08:56:15 AM »
    Your logic is backward.  He does not need a batch file to read or write Excel files.  He needs to know how to import data into Excel.
    No. I import (write) text files into excel all the time with Vbscript.  There is nothing illogical about it.

    Salmon Trout

    • Guest
    Re: batch file to convert text file into excel
    « Reply #5 on: February 01, 2017, 11:56:33 AM »
    I import (write) text files into excel all the time with Vbscript.  There is nothing illogical about it.
    Absolutely.