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

From: C J Kenneth Tan -- OptimaNumerics <cjtan ~~ OptimaNumerics.com>
Date: Tue, 15 Feb 2005 18:35:16 +0000 (UTC)

Another solution: 'addcr' and 'delcr' from UCSPI-TCP package
(http://cr.yp.to/ucspi-tcp/addcr.html).

Kenneth Tan
-----------------------------------------------------------------------
News: OptimaNumerics Libraries 3.0: 200% Faster!
-----------------------------------------------------------------------
C. J. Kenneth Tan, Ph.D.
OptimaNumerics Ltd.
E-mail: cjtan ~~ OptimaNumerics.com      Telephone: +44 798 941 7838    
Web: http://www.OptimaNumerics.com    Facsimile: +44 289 066 3015 
-----------------------------------------------------------------------

On 2005-02-15 09:45 -0000 Noel O'Boyle (noel.oboyle2 ~~ mail.dcu.ie) wrote:

> Date: Tue, 15 Feb 2005 09:45:05 +0000
> From: Noel O'Boyle <noel.oboyle2 ~~ mail.dcu.ie>
> To: polumrak <polumrak ~~ gmail.com>
> Cc: chemistry ~~ ccl.net
> Subject: CCL:end-of-line and Gaussian for Linux
> 
> 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!
> > 
> > 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?
> > 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;
> > 
> > }
> > 
> > 
> > 
> > HOME Page: http://www.ccl.net   | Jobs Page: http://www.ccl.net/jobs
> > 
> > 
> > 
> > 
> > 
> > 
> 
> 
> 
> -= 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 ~~ ccl.net
> 
> Send your subscription/unsubscription requests to: CHEMISTRY-REQUEST ~~ 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 ~~ nd.edu (read about it on CCL Home Page)
> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> 
> 
> 
> 
> 
>