Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-27-2011, 11:39 AM   #1
LQ Newbie
Registered: Sep 2011
Posts: 1

Rep: Reputation: Disabled
[Noob] Merging line of a file for consolidation...

Hi there,

I was wondering if somebody has already got this tricky one. I'm trying to consolidate a huge CSV file with a lot of values so server comparison. This file is similar to the example below:








As you can see, in server2 example, I need to merge all the occurrences of it replacing all zero values with a non zero value where applicable.

Not sure if I made myself clear. Any clues?
Old 09-27-2011, 12:46 PM   #2
LQ Guru
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,600

Rep: Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926
ummmm .. huh?? Is the idea that once you have run something over this file each server will only have a single entry where all the '1' values should prevail over a '0'?
Old 09-27-2011, 12:56 PM   #3
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
I think OP is saying he wants to do a bitwise OR on a per-colum basis (for matching server #s). So:
Would compute to:
Sounds like homework.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Small Help required for merging two files per line!!! rockf1bull Red Hat 4 10-05-2011 08:06 AM
Merging 4 files into a single file sudheerkappala Linux - General 3 10-27-2008 02:07 AM
XML File merging shourya21 Linux - Newbie 0 01-29-2008 09:15 AM
Merging gifs into printable file jackassjim Linux - Software 2 03-28-2005 01:51 PM
WP for cmd-line data merging & printing? MikHud Linux - Software 0 11-06-2002 02:36 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration