This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Parse text file and query dabase and email missingList as CSV file

 
sai rama krishna
Ranch Hand
Posts: 411
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a pipe(|) separated text file with many rows of data. I need to parse the text file and generate a query and query database and see which records are not there in database( each row of the text field corresponds to each record in database). Then I need to prepare missing List CSV file and email the user about the missing list values. I am treating whole text file as array object and individual rows as again small arrays with many values(could be string, numericals etc) separated by | symbol.
Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12021
25
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My general suggestions are always the same:

Separate your tasks into the individual components. Reading a file is a distinct task from querying the database. Parsing a string is a distinct task from building a query.

Only work on one task at a time. Test it over and over and over and make sure it works before doing the next task.
 
sai rama krishna
Ranch Hand
Posts: 411
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you.

http://www.velocityreviews.com/forums/t390377-using-scanner-with-a-bar-delimiter.html

I checked above link.

It is separating at |.

Now I need to get first two strings and form a query with those first 2 stings to run againest the oracle database.

Then generate missing list CSV report(with those first two strings) if those records not present in oracle databse and email the the user missing CSV file(i have the emailing part code also with me).

I am not sure on how to do following things


>>
Now I need to get first two strings and form a query with those first 2 stings to run againest the oracle database.

>>
Then generate missing list CSV report(with those first two strings) if those records not present in oracle databse

Please advise
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12021
25
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This:
Now I need to get first two strings and form a query with those first 2 stings to run againest the oracle database.

is at LEAST three things:
1) Get the first two strings
2) Form a query from two strings
3) Run a query against a database.

Focus on one at a time.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic