Thursday, 15 January 2015

java - regular expression for extracting some data from a text file -



java - regular expression for extracting some data from a text file -

i have text sentences format:

sentence 1 sentence. t-extraction 1 sentence s-extraction 1 this_dt is_v a_dt sentence_n sentence 2 ...

as see, lines separated come in key. sentence, t-extraction, s-extraction words repeated. numbers sentence numbers 1,2,.. . phrases separated tab key illustration in first line: sentence(tab)1(tab)this sentence. or in sec line:t-extraction(tab)1(tab)this(tab)is(tab)a sentence.

i need map of these info in sql table, should extract them. need first , sec sentence(without sentence word in first lines , t-extraction , numbers in sec lines). each separated part tab mapped in field in sql (for illustration 1 in 1 column, this sentence in 1 column, this (in sec lines) in 1 column, , is , a sentence ).

what suggestion? in advance.

you utilize string.split().

the regex utilize [^a-za-z_]+ or [ \t]+

java sql regex

No comments:

Post a Comment