从文件中读取时的问题 [英] problem while Reading from file
本文介绍了从文件中读取时的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经在pro C中编写了一个程序,从文件中逐行读取(每行是字符串)
并在where条件下给出sql查询。我遇到的问题是,当我从文件中读取一行时,它还会读取一个新的行字符。所以,当我将此字符串提供给sql查询时,它显示此条件不存在任何记录。
Hi,
i have written a program in pro C to read line by line from file(each line is string)
and given to sql query in where condition. What the problem i have faced is when i read from file a line it also read a new line character.So when i give this string to sql query it displays no records exists for this condition.
展开 | 选择 | Wrap | 行号
推荐答案
i有在pro C中编写一个程序,从文件中逐行读取(每行是字符串)
并在where条件下给出sql查询。我遇到的问题是,当我从文件中读取一行时,它还会读取一个新的行字符。所以,当我将此字符串提供给sql查询时,它显示此条件不存在任何记录。
Hi,
i have written a program in pro C to read line by line from file(each line is string)
and given to sql query in where condition. What the problem i have faced is when i read from file a line it also read a new line character.So when i give this string to sql query it displays no records exists for this condition.
展开 | 选择 | Wrap | 行号
还可以选择pincodefromfil到length - 1(消除\ n)然后进行比较!!
One more option could be you can substr the pincodefromfil till length - 1 (eliminate \n) and then do a comparison!!
另外一个选项可能是你可以将pincodefromfil直到length - 1(消除\ n)然后再比较!!
One more option could be you can substr the pincodefromfil till length - 1 (eliminate \n) and then do a comparison!!
很好,我做到了。但它还没有工作。
这就是我做的
Fine i did it.But it is not worked yet.
this is what i did
展开 | 选择 | Wrap | 行号
这篇关于从文件中读取时的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文