Solved

Parsing text files with perl?

Posted on 2000-03-28
16
227 Views
Last Modified: 2010-03-05
I have a VBA macro that parses a text file and displays the information into Excel.  I'd like to do the same thing but parse the files with perl and have them displayed in an HTML table.  I'm going to require a lot of help with this so am looking for someone to work closely with.  I will post 40 points now but will increase later.  If you can help please contact me :)
0
Comment
Question by:treyjeff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 7
16 Comments
 
LVL 16

Expert Comment

by:maneshr
ID: 2665110
pl. post your sample input data and the desired output here.

i think i can come up with a script for the same.
0
 
LVL 1

Author Comment

by:treyjeff
ID: 2665276
It would be much easier if you had Excel and i could send you what you need :)  I have some things zipped at http://www.hyrum.net/vensched.zip
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2665311
ok i have downloaded the zip file. it has a csv and a .xls file in it.

the csv file has 5 cols in it. is this the data that forms the input??
will this data already be in .csv format??

if ans to the above is yes, how do you want to present the data in HTML??

let me know
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:treyjeff
ID: 2665361
Can you open the xls file?  Excel.  It also pulls data from other csv files so I think everything will be pulled from about 7 files.  Just one or two columns per though I think.  I would like it all in a table format and the thing is, i want to be prompted for a vendor code, much like the excel file is doing.
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2665366
i opened the .xls file and it starts some VBA code. since the path and other settings on my PC are diff, it gives me a debugger error.

i want you to tell me what the VBA does and what you want to implement in PERL.

0
 
LVL 1

Author Comment

by:treyjeff
ID: 2665406
The paths can be changed in the VBA code but here is what it does.  The csv files are files that are automatically generated by another system we have and they are used for a vendor purchasing schedule.  We would usually have our vendors call us and our sales people would use the Excel file to see what is needed.

We want the vendor to be able to login to our website and see what we need.  It pulls vendor name, part number. description, dates needed etc.  Everything we want done in html is in the VBA, just need to port it over for html tables.  It would be ideal to do some formatting after but that is after,
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2665413
ok so from what i understand this is what you need.

* CGI script for internal use (for sales folks) that would allow them to query on vendor ID and/or buyer name.

* CGI script for outsiders (vendors) that would allow them to see what your requirements are.

Finally data presentation in HTML.

let me know if the above is right.
0
 
LVL 1

Author Comment

by:treyjeff
ID: 2665419
The cgi for inside isn't needed.  They can continue to use the Excel file OR they can view the same thing the vendor can on the website.  So we need one script for the vendors and data presentation for the web.  I have never parsed files so it's new to me.
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2665427
good.

now can you provide me the input file that this cgi script would read to allow that query.
in the zip file that i picked up, there is only ONE csv file. is that the only file required??

if not send me all the input files via email (maneshr@hotmail.com) or on your website like you did before.

0
 
LVL 16

Expert Comment

by:maneshr
ID: 2665429
good.

now can you provide me the input file that this cgi script would read to allow that query.
in the zip file that i picked up, there is only ONE csv file. is that the only file required??

if not send me all the input files via email (maneshr@hotmail.com) or on your website like you did before.

0
 
LVL 1

Author Comment

by:treyjeff
ID: 2665474
I have sent them.  If you can open the excel file you can change the path of these files so that you can see how it's all laid out.
0
 
LVL 1

Author Comment

by:treyjeff
ID: 2665490
Adjusted points from 40 to 45
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2665543
i got 7 files (Pur001.csv, Pur002.csv, Pur015.csv, Pur018.csv, Pur019.csv, Spur012.csv, Spur013.csv) in pur directory and 1 file (Smat007.csv) in the mat directory.

can you tell me what each of this file is meant for and the various columns that are present. Also let me what is it that the vendor can search on with an eg.

0
 
LVL 16

Accepted Solution

by:
maneshr earned 100 total points
ID: 2665553
i got 7 files (Pur001.csv, Pur002.csv, Pur015.csv, Pur018.csv, Pur019.csv, Spur012.csv, Spur013.csv) in pur directory and 1 file (Smat007.csv) in the mat directory.

can you tell me what each of this file is meant for and the various columns that are present. Also let me what is it that the vendor can search on with an eg.

0
 
LVL 1

Author Comment

by:treyjeff
ID: 2749137
Adjusted points from 45 to 100
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2749173
Thanks TJ :-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question