• Post Reply Bookmark Topic Watch Topic
  • New Topic

Read a file and write them into different files based on unique words in each line  RSS feed

 
sravanthi sari
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Input to the program would be start and end position of the unique word in each line from db and a text file.

For example: for the below input file start position is 0 and end position is 6 which is ABCDEF,store this value and compare with the first 6 characters in second line ifs its same copy them into same file else copy them into another file.For every file there can be 'n' no unique words ,n different files need to be created dynamically.positions will change file to file.The file size can be more than 10gb

Original input file: originalfile.txt ABCDEF aksjlnf woeirf 234 1234

FJHIJK sdfdf 3412344 124

ABCDEF asdhgbfl 3 agagd

FJHIJK agagafg 1 agag

output should be:splitfile1.txt

ABCDEF aksjlnf woeirf 234 1234

ABCDEF asdhgbfl 3 agagd

splitfile2.txt FJHIJK sdfdf 3412344 124

FJHIJK sdfdf 3412344 124
 
Knute Snortum
Sheriff
Posts: 4281
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

What have you done so far? Post your code and please UseCodeTags (← that's a link).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!