Solved

Parsing text files with perl?

Posted on 2000-03-28
16
186 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
  • 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now