Author |
Message
|
Siddu |
Posted: Sat Oct 06, 2012 11:52 pm Post subject: Reading a Text file from MQ Input queue |
|
|
Apprentice
Joined: 22 Aug 2012 Posts: 44
|
Hi all,
I've requirement where I've to parse a text file to extract the contents.
The text file looks like this:
S.No TMID FirstName MiddleName LastName
1 xxxx ffffff mmmm llllllllll
2
3
....
....
There are 100 lines (S.No#) in a text file.
The file will be landed in MQ Input node by MFT and hence we don't have to get it manually (i.e no need to use FTPInput node).
Now I've to extract TMID from each line of the text file.
Please help me in identifying these:
1. How to read the text file line by line.
2. How to extract TMID from each line.
3. How to parse the text file? (For XML we use InputRoot.XML.* similarly how to parse the text file)
4. Do I need to use Message Set? If yes then how to set a message set to read a text file?
Your help is greatly appreciated.
Thanks in advance.
Regards
Siddu
 |
|
Back to top |
|
 |
smdavies99 |
Posted: Sun Oct 07, 2012 2:18 am Post subject: Re: Reading a Text file from MQ Input queue |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Siddu wrote: |
Hi all,
3. How to parse the text file? (For XML we use InputRoot.XML.* similarly how to parse the text file)
|
May I humbly suggest that:-
1) you get some proper training.
2) Read many of the posts in this forum becasue most of what you are asking is answered there.
Why do I say this?
simply because you should never use InputRoot.XML. As is regularly pointed out her the XML Parser is deprecated and should not be used for new development. There are other parsers that handle XML structured documents better than the old XML parser.
Add to that the fact that your input (as shown) is not XML so using InputRoot.XML{whatever parser you choose} isn't gonig to make a lot of sense. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Last edited by smdavies99 on Sun Oct 07, 2012 5:42 am; edited 1 time in total |
|
Back to top |
|
 |
mqjeff |
Posted: Sun Oct 07, 2012 4:31 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Talk to the person who sits next to you at work. Ask them for assistance. |
|
Back to top |
|
 |
Vitor |
Posted: Sun Oct 07, 2012 7:15 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
Talk to the person who sits next to you at work. Ask them for assistance. |
This is basic, basic stuff. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Siddu |
Posted: Sun Oct 07, 2012 9:34 am Post subject: Re: Reading a Text file from MQ Input queue |
|
|
Apprentice
Joined: 22 Aug 2012 Posts: 44
|
smdavies99 wrote: |
Siddu wrote: |
Hi all,
3. How to parse the text file? (For XML we use InputRoot.XML.* similarly how to parse the text file)
|
May I humbly suggest that:-
1) you get some proper training.
2) Read many of the posts in this forum becasue most of what you are asking is answered there.
Why do I say this?
simply because you should never use InputRoot.XML. As is regularly pointed out her the XML Parser is deprecated and should not be used for new development. There are other parsers that handle XML structured documents better than the old XML parser.
Add to that the fact that your input (as shown) is not XML so using InputRoot.XML{whatever parser you choose} isn't gonig to make a lot of sense. |
Hi Jedi,
Thanks for your suggestion.
Actually I'm just one month old to WMB and not have much experience.
I do know that I can't use InputRoot.XML/XMLNSC.* to parse the text file.
I wanted to to know how to use the MRM parser to parse the text file.
This is because in XML input the elements will be structured in tags but in text input we cannot identify the elements.
If we are using Message Set how to configure it. (Again, I'm new to MB!).
If there are already posts which I can refer for please do let me know. I would love to learn from it.
Really appreciate your guidance
 _________________ "Be honest. It is one of the few things that you can control in your life." |
|
Back to top |
|
 |
Siddu |
Posted: Sun Oct 07, 2012 9:40 am Post subject: |
|
|
Apprentice
Joined: 22 Aug 2012 Posts: 44
|
mqjeff wrote: |
Talk to the person who sits next to you at work. Ask them for assistance. |
Thanks for advise mgjeff. Really appreciate your suggestion.
But problem is no one at my workplace has much idea about WMB and I'm forced learn on my own.
I'm learning it by doing!
Please suggest me a good resource to learn WMB in detail.
Thanks in advance. _________________ "Be honest. It is one of the few things that you can control in your life." |
|
Back to top |
|
 |
broker_new |
Posted: Sun Oct 07, 2012 12:44 pm Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
there are few samples available in the samples Gallery. Check it out. _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
Vitor |
Posted: Sun Oct 07, 2012 2:53 pm Post subject: Re: Reading a Text file from MQ Input queue |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Siddu wrote: |
Actually I'm just one month old to WMB and not have much experience. |
Then training and/or mentoring from an experienced person is your best action.
Siddu wrote: |
I do know that I can't use InputRoot.XML/XMLNSC.* to parse the text file. |
As indicated above, never use the XML domain. It only exists for backward compatibility. Use XMLNSC or (in rare circumstances) XMLNS.
Siddu wrote: |
in text input we cannot identify the elements. |
If that's really true, you're doomed because if you can't identify the elements how do you expect WMB to do it? That's also not what your original post indicated.
Siddu wrote: |
If we are using Message Set how to configure it. (Again, I'm new to MB!). |
And you might as well ask "how do I use WMB?", which in effect you are. Message Set are almost 2 days of the training course.
Siddu wrote: |
If there are already posts which I can refer for please do let me know. I would love to learn from it. |
Did you notice this forum full of posts? Hint - you're posting in it. There's a search button top right of this page.
Siddu wrote: |
Really appreciate your guidance |
You don't need guidance. You need training and mentoring. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Sun Oct 07, 2012 2:57 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Siddu wrote: |
But problem is no one at my workplace has much idea about WMB and I'm forced learn on my own. |
So ask whoever purchased the WMB license how they expect to get any return on their investment without trained staff. Seriously. WMB is not cheap and at the moment they're wasting a lot of that by letting you sink or swim as you see fit.
[quote="Siddu"]I'm learning it by doing!
Siddu wrote: |
for a product this complex a long and painful road.
[quote="Siddu"]Please suggest me a good resource to learn WMB in detail. |
Someone will be along in a moment to give the links to the IBM training. Another alternative is to hire someone on contract for 3 months to set WMB up efficiently (which I doubt you've managed at your level of experience) and mentor you. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|