Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello to everybody and sorry for my bad english,
I have a project to do with Talend but I'm stuck in a task, and I don't know how to do.
I have a txt file in this format :
2015 01 01 -89.5 -179.5 1.0 262 262 262 262 262 262 262 262 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 260 260 260 260 260 260 260 260 260 260 260 261 261 260 260 260 260 260 260 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 261 262 262 262 262 262 262 262 262 262 262 262 262 262 263 263 263 263 263 263 263 263 263 263 263 263 263 264 264 264 264 264 264 264 264 264 264 265 265 265 265 265 265 265 265 265 265 265 266 266 266 266 266 266 266 266 266 266 266 266 267 267 267 267 267 267 267 267 267 268 268 268 268 268 268 268 268 268 268 268 268 268 268 268 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 269 268 268 268 268 268 268 268 268 268 268 268 268 268 268 268 268 268 268 268 268 268 268 268 268 268 268 268 268 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267
2015 01 01 -88.5 -179.5 1.0 259 259 259 259 259 259 259 259 258 258 258 258 258 258 257 257 257 257 257 257 256 256 256 256 256 256 256 256 256 256 256 256 256 256 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 256 256 256 256 256 256 256 256 256 256 256 256 256 257 257 257 257 257 257 257 257 257 257 257 257 257 257 257 257 258 258 258 258 258 258 259 259 259 259 259 259 259 260 260 260 260 260 260 260 260 260 260 261 261 261 261 261 261 261 261 262 262 262 262 262 262 263 263 263 263 263 263 263 263 264 264 264 264 264 264 264 265 265 265 266 266 266 266 267 267 267 267 267 267 267 268 268 268 268 268 268 269 269 269 269 269 269 269 269 270 270 270 269 270 270 270 270 270 270 270 270 270 270 270 270 270 270 269 269 269 269 269 269 269 268 268 268 268 268 268 267 267 267 267 267 267 267 267 267 267 267 267 267 267 267 266 266 266 267 267 267 267 267 267 267 267 267 267 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 266 265 265 265 265 265 265 265 265 265 265 265 265 265 265 265 264 264 264 264 264 264 264 264 264 264 264 264 263 263 263 263 263 263 262 262 262 262 262 262 262 262 262 261 261 261 261 261 261 261 261 261 260 260 260 261 261 260 261 261 260 260 260 260 261 261 261 261 261 261 261 261 261 261 261 261 261 261 262 262 262 262 262 262 262 262 262 262 262 262 262 262 262 262 262 262 262 262 262 262 262 262
a lot of rows like this.
I want to create a schema with the columns ( Year, Month, Day, longitude, latitude, X, Values -in this field i want to store all the remaining values in the same line but I dont know how.
I don't know how to do to put a screenshots so i give you the links :
http://www.developpez.net/forums/attachments/p204305d1458324501/logiciels/solutions-d-entreprise/bus...
http://www.developpez.net/forums/attachments/p204306d1458324504/logiciels/solutions-d-entreprise/bus...
http://www.developpez.net/forums/attachments/p204307d1458324507/logiciels/solutions-d-entreprise/bus...
As you see in the screenshots when I do this treatment I have just the first value stored in the last column.
So if you have an idea how to solve this problem, I would be very thankful to you.
String data = input_row.my_column;
String[] values = new String;
for(int i = 0; i<6; i++){
values = data.substring(0, data.indexOf(" "));
data = data.substring(data.indexOf(" ")+1);
}
output_row.col1 = values;
output_row.col2 = values;
output_row.col3 = values;
output_row.col4 = values;
output_row.col5 = values;
output_row.col6 = values;
output_row.col7 = data;