?
Solved

How do you: 1) compare two ASCII files line by line, 2) switch the position of surnames & first names

Posted on 2004-09-13
11
Medium Priority
?
892 Views
Last Modified: 2010-08-05
I have a regular function to carry out whereby firstly I need to:

1) compare two ASCII files line by line, searching for differences, possibly marking them, or even better removing them them reporting back a further list of removals.

2) In another ASCII list, switch the position of surnames & first names and output a new list.

How can I achieve this, is there one or two items of software out there that will assist?

Many thanks
0
Comment
Question by:bigstar
[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
  • 2
  • 2
  • 2
  • +1
11 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 12042533
Hi bigstar,

> 1) compare two ASCII files line by line, searching for differences, possibly marking them,
> or even better removing them them reporting back a further list of removals.
search for a tool called "diff" .. Its a standard unix utility which does exactly that ...

> 2) In another ASCII list, switch the position of surnames & first names and output a new list.
Another unix utility called "awk" can do that in one line ... post the format of the file

You did not post your platform ... If you are not on a *nix, try searching for a port of these utilities for your platform.

Sunnycoder
0
 
LVL 11

Expert Comment

by:acseven
ID: 12042802
Hi,

1) check this one: Active File Compare (http://www.formulasoft.com)

2) you could import the list to excel, with the name detection made by an empty space, switch the columns in excel, and then export back to txt with a space in between names
0
 

Author Comment

by:bigstar
ID: 12042813
Hi Sunnycoder,

Apologies, I should have stated the platform I'm using. It's Windows and specifically Win XP Pro.

I'll search for windows equivalents, but if you are able to do the same I'd appreciate it.

Thanks
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 11

Expert Comment

by:acseven
ID: 12042840
the active file compare tool is for windows, though there are more tools like that...
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 12042916
0
 

Accepted Solution

by:
Dinq earned 400 total points
ID: 12090354
TextPad helps me a lot when working with text files, and it will do a line by line compare, with options to not show differences based on white space (extra spaces or tabs) and will then autogenerate a separate document with the differences noted.

As for switching the names, excel is a good idea (download and use openoffice.org if you don't have excel)

Open the file in excel and import it as a delimited text file.  Hopefully there is a comma between the first and last(sur)names in your original text file.  If not, you might have to work with fixed width delimited (if the text file contains columns of data or tabs).

Then in excel (or open office) you will eventually get your firstname in one column and your surname in another column.  Just "cut" whichever column you want to move, and "paste" it back in the order you want.

Finally, if you need it back in txt format, just save it in the original format.

G'Luck

Dinq
0
 

Author Comment

by:bigstar
ID: 12091326
Hi, thanks for all the responses.

I've had to put this on hold for a few days, but I have tried the excel switching option, which worked great.

Where can I get 'Textpad'?
0
 

Expert Comment

by:Dinq
ID: 12118088
www.textpad.com

sorry I didn't include that.

Evaluation version available, last time I checked it's fully enabled so you can try it out for everything you might want to do.

Only $29.50 USD for a full license.

Dinq
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

All of the resources available today make learning a new digital media easier than ever-- if you know where to begin. This is a clear, simple guide to a few of the basic digital art mediums and how to begin learning them on your own.
If you're a modern-day technology professional, you may be wondering if certifications are really necessary. They are. Here's why.
Video by: Tony
This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

765 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