473,396 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

getting a part of a message in a excel folder

Hi

I am new to perl .My requirement is that I am querying database and fetching 2 data one is msg_nbr and other is tehre corresponding xml message.

I am getting all the xml message in a variable .Now what is need is to fetch only the part of the xml data whixch is enclosed within the tags <notag>anything..,..</noTag>. and export it to a excel sheet along withthe corresponding msg nbrs.

I am trying the follwing code

Expand|Select|Wrap|Line Numbers
  1. while (my @row_ary  = $sth->fetchrow_array)
  2. {
  3.         my @row = ($row_ary[0],
  4.                 $row_ary[1],
  5.                  );
  6.         $count++;
  7.         my $locMsgnbr = $row_ary[0];
  8.         my $locxmldata =  $row_ary[1];
  9. #       print("$locxmldata \n");
  10.     #            $row_ary[1] =~ /<noTag>(.*?)<\/noTag>/;
  11.         $locxmldata =~ m/<noTag>(.*?)<\/noTag>/;
  12.         #$row_ary[1] = ~ /<noTag>(.*?)<\/noTag>/;
  13.            $notagdata = $1;
  14.         print ("$notagdata \n");
  15.         my $rowName = 'A'.$count;
  16.         worksheet1->write($rowName,$row_ary[0],$notagdata);
  17.  
  18. }
  19.  
Please help.
Jan 3 '08 #1
1 1014
eWish
971 Expert 512MB
Are you having problems getting the regex to work or are you having other problems? When it comes to extracting data from attribute tags it is best to use a parser designed to do so.

--Kevin
Jan 7 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Alex | last post by:
Hi all, I've seen this noted in many posts, but nothing I've checked out gives me any clue on how to do this. Basically as my topic says, I have a DTS and I simply need to export some data...
12
by: D. Shane Fowlkes | last post by:
This most likely belongs in another forum but I thought I'd start here. I have a COM Object written in VB6. The DLL will access MS Excel and use it's Object Library to write a customized report...
1
by: Siv | last post by:
Hi, I referenced Excel via COM in References and selected the Excel Version 11.0 but somehow it picked up the Beta of Office 2007 in the Interop reference that gets pulled in as well. I decided...
2
by: iloveprincess | last post by:
Hi, I'm developing windows application using VB.Net 2005. I would like to send 'save' message using 'SendMessage' API to the excel appication. I've already got a handle of the excel window with...
2
by: radink | last post by:
I have an established secured access database. I would like to read fields in the Access DB while im in excel via the external database query tools. However im getting an error about not having...
3
by: ArmageddonAsh | last post by:
I'm trying to make an application that will allow the user to enter data into a flexgrid (that's done) and then save the data from that flexgrid into a CSV file but even though the file is made none...
0
by: TG | last post by:
Hi! Once again I have hit a brick wall here. I have a combobox in which the user types the server name and then clicks on button 'CONNECT' to populate the next combobox which contains all the...
0
by: Raymond Chiu | last post by:
Dear all, In my vb.net program, I am using excel object to create excel file and stored in a folder. How can it be converted to be pdf file automatically using dotnet coding or others? Actually...
9
Catalyst159
by: Catalyst159 | last post by:
I have a form which is used to calculate residential Floor Area Ratio (FAR). The form is structured into seven parts as follows: Part A: Maximum FAR and Floor Area: Part B: Gross Floor Area of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.