• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 895
  • Last Modified:

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

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
bigstar
Asked:
bigstar
  • 2
  • 2
  • 2
  • +1
1 Solution
 
sunnycoderCommented:
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
 
acsevenCommented:
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
 
bigstarAuthor Commented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
acsevenCommented:
the active file compare tool is for windows, though there are more tools like that...
0
 
DinqCommented:
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
 
bigstarAuthor Commented:
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
 
DinqCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now