Click here to Skip to main content
15,893,266 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
}


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
Posted
Updated 4-Feb-18 3:25am

1 solution

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.
 
Share this answer
 
Comments
four systems 5-Feb-18 4:37am    
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900