Skip to content

Commit

Permalink
Merge pull request Aniket965#932 from raghav7997/patch-1
Browse files Browse the repository at this point in the history
Added a flex program to remove special characters.
  • Loading branch information
Aniket965 authored Oct 9, 2018
2 parents b3d32b6 + 0f36031 commit d95881c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions FLEX/special_char.l
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* This program removes special characters from a file. It takes "spchar.txt" as input and stores the output in "wspchar.txt". */
%{
#include<stdio.h>
FILE *sp,*wsp;
%}

%%
[a-zA-Z ] {fprintf(wsp,"%s",yytext);}
. {fprintf(wsp,"");}
%%

int main()
{
sp=fopen("spchar.txt","r");
wsp=fopen("wspchar.txt","w+");
yyin=sp;
yyout=wsp;
yylex();
return 0;
}

0 comments on commit d95881c

Please sign in to comment.