在文本文档中查找数据的应用---C语言+dos
2012-02-05 20:18
232 查看
目的是搜索一个名称是否在文档中存在,存在的话显示出来。不是完全用C语言,结合一点批处理技术,实现起来比较简单
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<conio.h>
#include<string.h>
int main()
{
char string_to_be_find[100];
while(true)
{
char find[100]="find /I d:\\查找题目专用文档--随时更新--ma6174.txt \"";
printf("\t\t题目查找专用程序 BY ma6174\n\n");
printf("请输入要查找的题目名:");
gets(string_to_be_find);
if(strlen(string_to_be_find)==0)
{
system("cls");
continue;
}
strcat(find,string_to_be_find);
strcat(find,"\"");
system(find);
printf("是否将题目名加入文档?(y/n)");
char choice=getche();
if(choice=='y'||choice=='Y')
{
char write_in_file[100]="echo ";
strcat(write_in_file,string_to_be_find);
strcat(write_in_file," >>d:\\查找题目专用文档--随时更新--ma6174.txt");
system(write_in_file);
printf("\n\n题目名已经写入!");
Sleep(2000);
}
system("cls");
}}
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<conio.h>
#include<string.h>
int main()
{
char string_to_be_find[100];
while(true)
{
char find[100]="find /I d:\\查找题目专用文档--随时更新--ma6174.txt \"";
printf("\t\t题目查找专用程序 BY ma6174\n\n");
printf("请输入要查找的题目名:");
gets(string_to_be_find);
if(strlen(string_to_be_find)==0)
{
system("cls");
continue;
}
strcat(find,string_to_be_find);
strcat(find,"\"");
system(find);
printf("是否将题目名加入文档?(y/n)");
char choice=getche();
if(choice=='y'||choice=='Y')
{
char write_in_file[100]="echo ";
strcat(write_in_file,string_to_be_find);
strcat(write_in_file," >>d:\\查找题目专用文档--随时更新--ma6174.txt");
system(write_in_file);
printf("\n\n题目名已经写入!");
Sleep(2000);
}
system("cls");
}}
相关文章推荐
- 使用C语言删除文本文档中的一行数据
- 查找和替换文本和其他 Word 文档中的数据(转)
- 采用vb以十六进制的形式读取文本文档数据
- 数据结构实验: 树形结构及其应用(C语言)
- Excel数据分析与业务建模_第二章_查找函数VLOOKUP及HLOOKUP(语法及应用实例)
- C语言中如何实现建立和写入文本文档
- java提取rar文档中的文本数据
- Phreeze Criteria的应用,在两个表里面查找多个符合条件的数据
- C语言中文件操作--如何将文本数据正确读到字符串数组中
- 【Scikit-Learn 中文文档】处理文本数据 - scikit-learn 教程 | ApacheCN
- dealstring 处理文本文档的数据.
- 【Scikit-Learn 中文文档】处理文本数据 - scikit-learn 教程 | ApacheCN
- Google Android开发者文档系列-创建有内容分享特性的应用之接收其它应用程序发送的简单数据
- python 查找文本中数据并输出该行
- 【C语言】逐行读取文本数字数据,经过某种处理再逐行写入另外一个文本
- 25、数据结构笔记之二十五串应用之文本编辑
- 厦大C语言上机 1493 数据查找
- WPS将网上下载的文本文档数据转换为WPS表格文档形式
- 【Scikit-Learn 中文文档】处理文本数据 - scikit-learn 教程 | ApacheCN
- C语言 数据结构排序与查找 数据结构实验之排序二:交换排序