+ Reply to Thread
Results 1 to 3 of 3

Output to CSV format from cmd.exe?

  1. #1
    Registered User
    Join Date
    03-22-2017
    Location
    Westlake Village, CA
    MS-Off Ver
    2016
    Posts
    24

    Output to CSV format from cmd.exe?

    Hello, I am looking for the commands to help format a CSV file.

    Example:
    -o "C:\FriedmanBros.csv" -h-1 -s"," -w 400

    I understand '-h' removes the headers, but Id like to know what is possible...

    OR if there is a way, without human interaction, for a way to covert CSV to Excel (silently)

    I am trying to Output some data from SQL MS to a readable format/output for a client.

    Thank you!
    Chris

  2. #2
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Output to CSV format from cmd.exe?

    Depends what you mean by convert. CSV is a file format, Excel is not. Excel has its own file formats (.xls, .xlsx, .xlsm, .xlsb, etc.) which is likely what you are looking for.

    A couple points. You can open a CSV in Excel, conversion is only required to leverage formulas and features of Excel after saving and closing said file (otherwise its stripped out when saved as and opened as csv again).

    Just about any way you look to do this will require opening Excel (regardless of if you notice it opening or not). Otherwise you are likely looking at 3rd party software that provides access via the command line.

    If you google converting csv to excel in the command line there are plenty of results using various methods, VBA, Python, VBS, etc. Pick your poison. Assuming the command you gave is in Windows CMD, I doubt there is any built in tool/command that can convert to MS Office file types. Most commands are going to open an instance of Excel (possibly without showing it) and save the file to the desired format.

    You should be very careful with any code/automated method of doing this to ensure it doesnt cause other problems (like overwriting the original). Test your code on dummy files in a dummy location before using in production.

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Output to CSV format from cmd.exe?

    if there is a way, without human interaction, for a way to covert CSV to Excel (silently)
    Perhaps like this but not sure the result will make you happy.

    Please Login or Register  to view this content.
    Alf

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to Format CORREL Output?
    By QuantEdge in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-22-2017, 07:49 AM
  2. Require correct format of output
    By mukeshbaviskar in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-12-2014, 08:49 AM
  3. CSV output file changes date format
    By mcinnes01 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-12-2010, 04:25 AM
  4. Format-want the final output
    By kiranindia1986 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-22-2010, 10:10 PM
  5. Output Format
    By tommyfernandez in forum Excel General
    Replies: 6
    Last Post: 12-18-2007, 06:48 PM
  6. report output format
    By Tim3057 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2006, 11:10 AM
  7. Web Query output, how to format?
    By kinmorr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2005, 02:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1