Menu

Error while trying to convert csv to html

Aniket Sen
2019-01-09
2022-01-18
  • Aniket Sen

    Aniket Sen - 2019-01-09

    Hi,

    I am a newbee at unix. I checked out the video for using tabulate to convert a csv file to an html on a tabular format. Trying to do the same a running into issues as below:

    cat export.csv | ./tabulate.sh -d "," -t "XXX" -h "Validation" > EmailBody.html
    db2 -tvmf export.csv | ./tabulate.sh -d "," -t "XXX" -h "Validation" > EmailBody.html

    both the above commands are giving the below error:
    cat: 0652-050 Cannot open /dev/stdin.

    I realise stdin refers to the input. is it not able to read the file. i tried giving the whole path as well, still the same. the export.csv has full permissions 0777.
    Unable to debug further.

    Please suggest.

     
  • Nathan S.R.

    Nathan S.R. - 2019-03-08

    Hi,

    Does

    cat export.csv | cat -

    return data on the terminal / console ?

    if so, then tabulate.sh must be able to read the data on its standard input, through the pipe.

    You may also try editing tabulate.sh, search for /dev/stdin and try substititing it with a hyphen character or a character that represents stdin on your unix machine. Also, discuss this with your sysadmin, if possible.

    Additionally, a small linux system like puppy linux can do the job as well.

    P.S. The latest version of tabulate.sh incorporates hyphen as the data to be read on its standard input.

    Also, for Systems without Bash, but having other shells, Some Unix Systems, Old Systems or Systems where this script fails for some reason, Please use this alternate Script : https://sourceforge.net/projects/command-output-to-html-table2/

    Hope this helps.

     

    Last edit: Nathan S.R. 2022-01-18

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.