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
891 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
Technology Partners: 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 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 100 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A list of useful business intelligence software.
Invest in your employees with these five simple steps to improve employee engagement and retention.
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 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