Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-06-2004, 03:06 PM
|
#1
|
|
Member
Registered: Jul 2003
Location: NC
Distribution: Fedora,Mepis,Debian
Posts: 84
Rep:
|
Need text pattern compare script
I am looking for a text compare program/script that basically compares white spaces. In other words; Are two files formatted the same even if the data in the various fields is different between the two files? I have looked at sed , awk, diff, cmp and several forums to try to locate such a tool but have been unsuccessful so far.
The details are that I have an automated process that generates a EDI transmittal file containing invoice details (price, manufacturer and product numbers, volumes, order number, quantity,etc. This file is sent to customer for payment. Occasionally there is a need to perform some manual manipulations to the file and I want to be able to compare the changed one to an untouched "properly formatted" one to see that the manual changes were performed properly (at least in regard to formatting)?
Thanks in advance.
|
|
|
|
05-06-2004, 03:17 PM
|
#2
|
|
Member
Registered: Oct 2003
Location: Springfield, MO
Distribution: Ubuntu, IPCop
Posts: 33
Rep:
|
Linux-friendly, but not Linux per se
It sounds like you have some programming chops, I'd reccomend looking at Regular Expressions for what you want. As for what kind of script, I'd say Perl myself but I'm biased towards it and not really aware of what might work best. With RegXs you could specify it to look for specific layouts of white space and new lines
I'm pretty sure Bash shell scripts will support regular expressions in addition to several of the Linux utilities...anyone else, yay, nay?
|
|
|
|
05-06-2004, 03:22 PM
|
#3
|
|
Member
Registered: Apr 2004
Distribution: Debian
Posts: 80
Rep:
|
i'd give a big 'yay' for Perl, but i think you'd have a pretty hard time finding a Perl programmer giving a 'nay', particularly for a text parsing gig
|
|
|
|
05-06-2004, 03:22 PM
|
#4
|
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
I'd probably go with perl too. What are you trying to compare - just blank lines or white space in other lines too? We could probably whip up a quick example if you can post a couple of example files, ie the before and after.
|
|
|
|
05-10-2004, 01:13 PM
|
#5
|
|
Member
Registered: Oct 2003
Location: Springfield, MO
Distribution: Ubuntu, IPCop
Posts: 33
Rep:
|
If someone more knowledgeable than I can reccomend a good module, he could hit CPAN and be on his way....
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:30 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|