Skip to main content
deleted 18 characters in body; edited title
Source Link
Gustavo Pagani
  • 7.1k
  • 5
  • 44
  • 77

Read Lineslines using Vert.x and RX2JavaRxJava


I'm reading a property file using Vert.x File System API and would need to do some transformations on it. The problem is that the File is not being read line by line but as a single chunk. So, assuming I have this property file:

I'm reading a property file using Vert.x File System API and would need to do some transformations on it. The problem is that the File is not being read line by line but as a single chunk. So, assuming I have this property file:

name=abc name=def 

And using this code:

vertx.fileSystem().rxReadFile("/path/file.properties") .map(buffer -> buffer.toString()) .subscribe(data -> { System.out.println(">"+data); }, err -> System.out.println("Cannot read the file: " + err.getMessage())); 

What I get printed is a single chunk of data:

>name=abc name=def 

I'd expect the following, as I have to perform transformations on each line:

>name=abc >name=def 

any help?

Read Lines using Vert.x and RX2Java


I'm reading a property file using Vert.x File System API and would need to do some transformations on it. The problem is that the File is not being read line by line but as a single chunk. So, assuming I have this property file:
name=abc name=def 

And using this code:

vertx.fileSystem().rxReadFile("/path/file.properties") .map(buffer -> buffer.toString()) .subscribe(data -> { System.out.println(">"+data); }, err -> System.out.println("Cannot read the file: " + err.getMessage())); 

What I get printed is a single chunk of data:

>name=abc name=def 

I'd expect the following, as I have to perform transformations on each line:

>name=abc >name=def 

any help?

Read lines using Vert.x and RxJava

I'm reading a property file using Vert.x File System API and would need to do some transformations on it. The problem is that the File is not being read line by line but as a single chunk. So, assuming I have this property file:

name=abc name=def 

And using this code:

vertx.fileSystem().rxReadFile("/path/file.properties") .map(buffer -> buffer.toString()) .subscribe(data -> { System.out.println(">"+data); }, err -> System.out.println("Cannot read the file: " + err.getMessage())); 

What I get printed is a single chunk of data:

>name=abc name=def 

I'd expect the following, as I have to perform transformations on each line:

>name=abc >name=def 
Source Link
Carla
  • 3.4k
  • 9
  • 48
  • 81

Read Lines using Vert.x and RX2Java


I'm reading a property file using Vert.x File System API and would need to do some transformations on it. The problem is that the File is not being read line by line but as a single chunk. So, assuming I have this property file:
name=abc name=def 

And using this code:

vertx.fileSystem().rxReadFile("/path/file.properties") .map(buffer -> buffer.toString()) .subscribe(data -> { System.out.println(">"+data); }, err -> System.out.println("Cannot read the file: " + err.getMessage())); 

What I get printed is a single chunk of data:

>name=abc name=def 

I'd expect the following, as I have to perform transformations on each line:

>name=abc >name=def 

any help?