Subject: Re: CCL:end-of-line and Gaussian for Linux

From: Reinaldo Pis Diez <pis_diez-.at.-yahoo.com.ar>
Date: Tue, 15 Feb 2005 07:49:29 -0300

polumrak wrote:
> 
> We've start using Gaussian only 6 month ago and...
> Well, that's a common problem - input files, created with GaussView
> for Windows comes in windows end-of-line format, which is not
> acceptable for UNIX Gaussian.
> Yes, you can convert them with something like Openoffice.org, Kate...
> or any another X editor... But who need that?

	There's an utility in Linux (at least) called dos2unix doing what you 
need, "dos2unix -n input.gjf input.com". There's no need to reinvent 
the wheel.
	Regards,

					Reinaldo

---

From: "Noel O'Boyle" <noel.oboyle2-.at.-mail.dcu.ie>
Date: Tue, 15 Feb 2005 09:45:05 +0000

Nice program, but this is a well-known problem and the solution is
available for both Windows and Linux:

dos2unix and unix2dos

Noel

On Mon, 2005-02-14 at 18:05, polumrak wrote:
> Hello guys!
> So Mr. Svetlichny wrote the tiny utility, which we call Converter.
> It simply deletes wrong EOLs from files which you gives them.
> I know that people can easily do that with one line Perl or Python
> script, but... who cares? :)))
> 
> That's ANSI C source code. If you want to use converter, save it to
> file, (name it "converter.c" for example), then just compile it with
> your favorite compiler.
> On Linux you can make so:
> gcc -o converter converter.c
> then run binary converter: ./converter
> You will see its output. Of course you need gcc installed.
> You can do that under Windows with your favorite C compiler.
> 
> So now just type in something like that:
> >./converter lalala.gjf lalala.com
> under Linux, or
> converter.exe lalala.gjf lalala.com
> And you will get your desired input for UNIX Gaussian :)
> 
> Okay, that's it: 
> 
> /*   delete 0d from string   */
> 
> 
> #include "stdio.h"
> #include "string.h"
> #include <stdlib.h>
> 
> int main(int argc, char * argv[])
> {
> 
> 	char szBin[50], szHex[50];
> 	char iData;
>         FILE *fpBin, *fpHex;
> 
> 	if (argc<2)
> 		{
> 		printf("\Deletes 0x0d at the end of every string \n");
> 		printf("Usage: convert inputfile.ext outputfile.ext \n");
> 		printf("14 feb 2005 by V.Svetlychny\n");
>         	printf("\n");
> 		exit(0);
> 		};
> 
> 
> 	/* make filenames */
> 	strcpy(szBin, argv[1]);
>         strcpy(szHex, argv[2]);
> 	fpBin = fopen(szBin,"rb");
> 	if (fpBin==NULL)
> 		{
> 		printf("Cannot open %s\n",szBin);
> 		exit(1);
> 		}
> 
> 	fpHex = fopen(szHex,"wb");
> 	if (fpHex==NULL)
> 		{
> 		printf("Cannot open %s\n",szHex);
> 		exit(1);
> 		}
> 
> 	/* read and write */
> 	putchar('\n');
> 	printf("Writing to %s:\n",szHex);
> 	putchar('\n');
> 	putchar('\n');
> 
>         while (1) {
>               iData=fgetc(fpBin);
>               if(iData==EOF) break;
>               putchar(iData);
>               if(iData != 0x0d) fputc(iData, fpHex);
>         };
> 	fclose(fpBin);
> 	fclose(fpHex);
> 	putchar('\n');
> 	putchar('\n');
> 	putchar('\n');
>         printf("End of file\n");
> 
>         return 0;
> 
> }
> 
> 
> -= This is automatically added to each message by the mailing script =-
> To send e-mail to subscribers of CCL put the string CCL: on your Subject: line
> and send your message to:  CHEMISTRY-.at.-ccl.net
> 
> Send your subscription/unsubscription requests to: CHEMISTRY-REQUEST-.at.-ccl.net 
> HOME Page: http://www.ccl.net   | Jobs Page: http://www.ccl.net/jobs
> 
> If your mail is bouncing from CCL.NET domain send it to the maintainer:
> Jan Labanowski,  jlabanow-.at.-nd.edu (read about it on CCL Home Page)
> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> 
> 
> 
> 
>