Main Area and Open Discussion > General Software Discussion
merge two files to one
(1/1)
ljbirns:
I have two txt files. One is year 2005 customers and sales to date. The other is 2006 customers and sales to date. I would like to create one file so that I can easily see a sales
comparison one file. The file looks like this for each account,
ACCOUNT:00044 XXXXX YYYYY XXXXX LOS ANGELES CA,
ACCOUNT:00044 TOTAL $: 91.75 INVOICD: 91.75 ,
ACCOUNT:00044 TOTAL UNITS: 4 INVOICD: 4
What software could I use to do this ? ( XP Pro SP2 )
And no the DOS propriatery software program we use for invoiceing etc can't do this.
Thanks
rjbull:
You mentioned DOS, so presumably you are happy with command lines. If I understand you correctly, and the file format is exactly as described, you could try concatenating your files, e.g.
copy file1.txt+file2.txt bigfile.txt
(or use a "cat" program) and sort the result with any sort program. Or, in one pass and very fast, try RPSORT, available from DOS legacy sites e.g. the Free Software for DOS Web site. Their sort utilities page is http://home.att.net/~short.stop/freesoft/txtutil2.htm#sort
From RPSORT's help:
--- ---Usage: RPSORT [/Q] [/Eerrfile] [/]? [inputfile[+inputfile]] [outputfile] [/A]
[/B] [/C] [/D] [/Fnnnn] [/N] [/P] [/R] [/td][/tr][/table] [/Z] [sort key defin...]
Sort key defin syntax: /+ [col] [:len] [A] [C] [F] [I] [M] [P] [R] [T] [U]
-------------------------------------------------------------------------------
Parameters may be entered in any order except as noted below.
RPSORT may be run as a filter using redirection.
For example: RPSORT <ipfile >opfile
or: DIR | RPSORT | MORE
Input and output may be specified directly. Input is one or more
filespecs separated by plus signs. Output must be a single file.
Input filespec(s) must precede output filespec. Filespecs may
include a path. Wildcard characters are allowed. Input files are
sorted together into the single output file.
For example: RPSORT ipfile*.txt+c:\mydir\ip??file.txt opfile
By default, RPSORT assumes the input is a text file and that the
entire line is the sort key. The sort is case insensitive (lower
equals upper case) and just like the DOS SORT it equates foreign
letters, punctuation, and currency symbols to their English
equivalents. The following screens describe other options.
ljbirns:
rjbull
Thanks. That is a good idea. I will try that. I also found two Window programs that put the two files side by side > Beyond Compare and KDiff ( Sourceforge )
So my problem is solved.
Thanks
mouser:
i am a HUGE fan of Beyond Compare;
for open source you might also try WinMerge (http://winmerge.org/)
ljbirns:
Mouser
I like it too. Is there a way that I can manipulate each window individually ?
Navigation
[0] Message Index
Go to full version