[20160731]read a file and print it on the screen
//read a file and print it on the screen
import java.io.*; public class MyPrintStreamTest2{
public static void main(String[] args) {
String filename = args[0]; // firsttime to see!!!
if(filename!=null){ list(filename,System.out); }
} public static void list(String filename,PrintStream ps){
try
{
BufferedReader br = new BufferedReader( new FileReader(filename) );
String s = null;
while ((s=br.readLine())!=null) {
ps.println(s);
}
br.close();
} catch(IOException e)
{
ps.println("reading file error!");
} }
}
[20160731]read a file and print it on the screen的更多相关文章
- learning Perl:91行有啥用? 88 print "\n----------------------------------_matching_multiple-line_text--------------------------\n"; 91 my $lines = join '', <FILE>;
89 open FILE, "< file_4_ex_ch7.txt" 90 or die "cannot open file: $!"; ...
- 主机宝(zhujibao) /a/apps/zhujibao/manager/apps/config/config.php no-password Login Vulnerabilities Based On Default cookie Verification From Default File
catalog . 漏洞描述 . 漏洞触发条件 . 漏洞影响范围 . 漏洞代码分析 . 防御方法 . 攻防思考 1. 漏洞描述 主机宝管理程序使用了CodeIgniter框架,要想在CodeIgnit ...
- Android 学习笔记之数据存储SharePreferenced+File
学习内容: Android的数据存储.... 1.使用SharedPreferences来保存和读取数据... 2.使用File中的I/O来完成对数据的存储和读取... 一个应用程序,经常需要与用 ...
- Python 通过print将数据保存到文件中
1. Print them to screen man = [] other = [] try: data = open('sketch.txt') for each_line in data: tr ...
- swat主流域文件(file.cio)参数详解——引自http://blog.sciencenet.cn/blog-922140-710636.html
% file.clo,即主流域文件用于文件管理,包括与模型选项.气候输入.数据库和输出控制相关的信息. Master Watershed File: file.cio Project Descript ...
- Java开发之File类
File类 File类是对文件系统中文件以及文件夹进行封装的对象,可以通过对象的思想来操作文件和文件夹. File类保存文件或目录的各种元数据信息,包括文件名.文件长度.最后修改时间.是否可读.获取当 ...
- File类的基本操作之读出所有目录路径
package org.mark.file; import java.io.File; /** * File类的基本操作之读出所有文件夹路径 * 假设给定一个文件夹,要求将此文件夹中的所有文件都列出来 ...
- File类学习笔记
File类 首先,要明确的一点就是,在整个IO包中,唯一表示与文件有关的类局势File类. 它可以实现创建或删除文件等操作.下面看看它的构造方法: File(String pathname) 通过将给 ...
- python文件和文件夹訪问File and Directory Access
http://blog.csdn.net/pipisorry/article/details/47907589 os.path - Common pathname manipulations 都是和路 ...
随机推荐
- Linux笔记-常用的命令(15-3-30)
vim命令参考: http://www.cnblogs.com/softwaretesting/archive/2011/07/12/2104435.html [1]解压文件格式的区别: *.tar ...
- VS2015 推荐插件
VS2015 推荐插件 //////////////////////////////////////////////////////////////////////////////////////// ...
- Python之路【第七篇续】:进程、线程、协程
Socket Server模块 SocketServer内部使用 IO多路复用 以及 “多线程” 和 “多进程” ,从而实现并发处理多个客户端请求的Socket服务端.即:每个客户端请求连接到服务器时 ...
- Jquery中的$().each() 方法
先举例子, 输出每个 li 元素的文本: <html> <head> <script type="text/javascript" src=" ...
- css display 总结
1. 块级元素(display: block) 1.1. 独占一行 1.2. 高度.宽度.行高.顶和底边距 可设置 1.3. 默认宽度 父容器100% 2. 内联元素(display: inline) ...
- echarts X轴数据显示不全问题
很奇怪,X轴只显示了部分节点.没有显示全. 在xAxis上加上下面的配置就能解决: xAxis: [ { type: 'category', axisLabel :{ interval:0 }, // ...
- Android Studio-设置快速转换局部变量为成员变量
"File"-"Settings"-"KeyMap"-"Main Menu"-"Refactor"- ...
- js中url解码
var name = window.location.search.substr(4,30);//name = decodeURI(name);//使用示例document.getElementByI ...
- C语言内存管理(转)
伟大的Bill Gates 曾经失言: 640K ought to be enough for everybody — Bill Gates 1981 程序员们经常编写内存管理程序,往往提心吊胆.如果 ...
- 统计学 nested_design 嵌套设计
nested_design 嵌套设计 li_volleyball ,邓邦良 2016年3月6日 嵌套设计 一.基本概念 嵌套设计(nested design)又称为窝设计和套设计,与析因设计的处理不同 ...