从文件更改中读取内容并修改打印

编程入门 行业动态 更新时间:2024-10-28 21:20:06
本文介绍了从文件更改中读取内容并修改打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

条件字符串排序的方式是什么 比如说 java.txt有内容 计算机科学{w} [java。] [péj。]人工智能[coll。] Java {c} [和](+)Android 带有java缓冲读取内容的

what is the way for conditional string sort say for instance java.txt has the contents Computer Science {w} [java.] [péj.] Artificial Intelligence [coll.] Java {c} [and] (+) Android with java buffered read read contents

String fileName = "src/FileSystem/java.txt"; try (BufferedReader br = new BufferedReader(new FileReader(fileName))) { print changed contents }

应打印 计算机科学人工智能 Java Android 文件中有很多其他记录,但必须更改,以便按要求结果 我有什么试过: 带有几种组合的java文件阅读器

should print Computer Science Artificial Intelligence Java Android there are lot of other records from file but must change so that result is as required What I have tried: java file reader with several combinations

推荐答案

它叫做解析。您读取每一行并提取未被括号括起来的字段并打印其余部分。 Java String类将有很多辅助方法来帮助您。 It's called parsing. You read each line and extract the fields that are not surrounded by brackets and print the rest. The Java String class will have plenty of helper methods to assist you.

更多推荐

从文件更改中读取内容并修改打印

本文发布于:2023-10-29 22:41:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1540973.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   内容

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!