08-17-2009
to get two almost identical rows into one
Hi All,
I am having hard time in getting two almost identical rows into one, I know how to do if starting word is unique, anyhow this is my problem
Input File:
issue1 5167
dum 1 1 kkk 7888
dum 2 1 ffff 7888
dum 2 2 llll 7888
dum 3 1 eee 7888
issue2 7667
dum 2 1 jjjj 8999
dum 2 2 jjjj 8999
dum 3 pppp 8999
Output should be:
issue1 5167 1 kkk 2 ffff 2 llll 3 eee
issue2 7667 2 jjjj 3 pppp
Can someone give me a idea, of how to proceed with this, would be grately helpful if anyone can put all those ideas into writing...
Thanks,
Ricky
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I am taking backup in every hr and every day, I want to programmatically check my backup files are identical with original files. Any methods are available in Unix scripts? Any idea.? I don't want to download both and compare, I looking for idea to develop a script to read both files and... (3 Replies)
Discussion started by: redlotus72
3 Replies
2. Shell Programming and Scripting
Hi Friends,
We have four filenames with first few digits are identical.From those files, i need to pick up 2 files based on my parameter.
The following example will give more information to understand my question.
Files in the directory:
small_customer_aa.csv
small_customer_ab.csv... (6 Replies)
Discussion started by: HAA
6 Replies
3. Shell Programming and Scripting
I am looking to replace two or more strings on different lines using sed, but not with the same variable. IE
# cat xxx.file
<abc>
abc def ghi
abc def ghi
abc def ghi
currently I can only change each line with the same pattern:
# sed -e '/<abc>/!s/abc\(.*\)/jkl mno/' xxx.file
abc jkl mno... (3 Replies)
Discussion started by: prkfriryce
3 Replies
4. UNIX for Dummies Questions & Answers
I tarred a directory from a linux server to a solaris server. When I do a du -s -k on the directory, I get almost 150k difference in the file sizes. If I do a ls | wc -l, it is the same. If I look at the size of the individual files, it is the same.
I did an ls on the 2 directories and... (6 Replies)
Discussion started by: csgonan
6 Replies
5. Shell Programming and Scripting
Hello Experts,
I have two files called "old" and "new". My old file contains 10 lines and my new file contains 10 + "n" lines.
The first field in both these files contain ID. I sort these two files on ID. I am interested in only the lines that are in the new file and not in old.
I tried... (4 Replies)
Discussion started by: forumthreads
4 Replies
6. Shell Programming and Scripting
I have a file that needs to be cleaned up. Here is the file:
Project
Project John
Project Gary
Project Sean
Project2
Project2 Lisa
Project2 Tyler
Project2 Sam
Project3
Project3 Mike
Project3 Bran
I need the o/p to be:
Project
John
Gary
Sean
Project2 (7 Replies)
Discussion started by: leepet01
7 Replies
7. Solaris
I've been testing mirroring root partitions for the past few days within a virtual environment and on an old ML350. However, the live system that this is practice for has two disks, and they're non-identical.
I've done a bit of searching through the forum and see that a lot of people recommend... (2 Replies)
Discussion started by: lm69a
2 Replies
8. UNIX for Dummies Questions & Answers
I have a file that looks like this 10 user1s, 5 user2s and 10 users3.
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.2 user2
10.10.1.2 user2
10.10.1.2 user2... (7 Replies)
Discussion started by: lawsongeek
7 Replies
9. Ubuntu
I have my Ubuntu system nicely tailored to my needs, with specific software installed, and other things removed.
I'd like to build a new PC, and have the identical software configuration on it. Is there some easy way to export the list of installed software to a file? Then have the new machine... (3 Replies)
Discussion started by: lupin..the..3rd
3 Replies
10. Shell Programming and Scripting
hey,
i m having a hard time trying to print only the first occurrence between 2 idenicale strings.
for the following output:
please
help
me im a
noob
please
im a noob
help me
noob
please
help
me im a
noob
please
im a noob
help me
noob (3 Replies)
Discussion started by: boaz733
3 Replies