Actually the input files are not correctly formatted , to format my files i have done below steps
1) my input files(file1,file2) has <=80 columns
so i increased my default columns in putty terminal to 180 by reducing the font and increasing system resolution since set COLUMNS was not working
2) since sdiff was working good for checking the differences and its formatting the data in input files to ignore spaces..etc
Code:
i have code all the below steps in format.sh
sdiff -W -w 168 -l file1 file2 > sdiff_file1
-w : setting columns
-W: eliminated white spaces
168 is the total colums( 84-file2,84-file1),it can be 160 but i used extra columns for readability
here am redirecting the formatted left side (file1) to sdiff_file1
sdiff -W -w 168 -l file2 file1 > sdiff_file2
similarly i swapped the files and got the (file2) to sdiff_file2
i have checked the output of both files , it contains "(" character at column 83
I don't quite understand why you need to all these steps, but that's beyond the point - you probably know better.
You can streamline all of these like so, e.g.:
For the 'The only issue' part.... I don't quite follow what you're after. Can you provide a snippet of a file BEFORE and AFTER - just a small snippet to illustrate the dilemma.
Now after generation of output from awk script , i am reviewing by comparing output file with original file, please consider the below scenario difference my external stupid GUI tools is reporting ,column lengths differ
Code:
actual file1 : columns refer to number of characters in a line
Note: actual file1 is the original file1 as it is without formatting
000001* <7 columns>
000002 This is line1 and file1 is the actual file. <52 columns>
000003 this is line2 <22 columns>
000004 this is line3 end of the file1 <39 columns>
Code:
output file ( generated from awk script )
000001* <82 columns>
000002 This is line1 and file1 is the actual file. <82 columns>
000003 this is line2 <82 columns>
000004 this is line3 end of the file1 <82columns>
all the lines are showing as 82 columns size , its shows as difference as length of columns does not match when i am comparing the both files
i want the output file to contain exactly the columns it occupies in original file
i have tried some tricks to delete the extra spaces after End of line but it mixing the contents in format shown below
Code:
000001* 000002 This is line1 and file1 is the actual file. 00003 this is line2 000004 this is line3 end of the file1
This seems pretty simple, but I cant figure it out. I get stumped on the simple things.
I am running two commands
1) take a listing a directory of files, and filter out the doc_name (which is in a series of extracted files), and place it in a file.
ls -l | awk '{print $9}' | grep... (5 Replies)
Hello everybody
Looking for help in comparing two files in Linux(files are big 800MB each).
Example:-
File1 has below data
$ cat file1
5,6,3
2.1.4
1,1,1
8,9,1
File2 has below data
$ cat file2
5,6,3
8,9,8
1,2,1
2,1,4 (8 Replies)
Hello everybody
Looking for help in comparing two files in Linux(files are big 800MB each).
Example:-
File1 has below data
$ cat file1
5,6,3
2.1.4
1,1,1
8,9,1
File2 has below data
$ cat file2
5,6,3
8,9,8
1,2,1
2,1,4 (1 Reply)
hi,
I have a file as below:
Name: some_name
Date: some_date
Function Name: <some_function_name(jjjjjjjjj,
fjddddd, gggg, ggg)>
Changes:<Change A
more of change A>
Name: some_name
Date: some_date
Function Name: some_function_nameB(jjjjjjjjj,
fjddddd, gggg, ggg)
Changes:Change B... (15 Replies)
Hi there,
I have 2 machines running HP-UX. One off these controllers is able to send mail and the other cannot. I have looked at all the settings that I know and coannot find any differences. Is there a way to audit the 2 machinces by pulling all the settings then compare any differences?
... (2 Replies)
Hi experts,
I'mvery new to shell scripting and learning it now
currently i am having a problem which may look easy to u :)
i have two files
File 1:
Start :Thu Nov 19 10:33:09 2009
ABCDGFSDJ.txt
APDemoNew.ppt
APDemoOutline.doc
ARDemoNew.ppt
ARDemoOutline.doc
File 2:
Start... (10 Replies)
Hello,
I am new to scripting and have been trying to compare two different directories, but with all the same file names in each directory for file changes. I have been doing it in baby steps and have been doing pretty good, but I have hit a few snags. Test 1 and Test 2 work great, but my... (4 Replies)
Hi,
I have a column in 2 different files which i want to compare, and output the results to a different file. The columns are in different positions in those 2 files.
File 1 the column is in position 10-15
File 2 the column is in position 15-20
Please advise
Thanks (1 Reply)
hi
i need to select a few columns of two txt files and write it to a new file. there is one common field for both of these files.
plz help me in this
thanks in advance (4 Replies)