Sponsored Content
Full Discussion: Fusion de 2 fichiers
Top Forums Shell Programming and Scripting Fusion de 2 fichiers Post 302364086 by Celmar on Thursday 22nd of October 2009 04:33:15 AM
Old 10-22-2009
Fusion de 2 fichiers

Bonjour,

je souhaiterais un script bash fusionnant 2 fichiers tout en virant les doublons.
Exemple :

fic1 :
toto
titi

fic2 :
toto
tata

Résultat souhaité, fic 3 :
toto
titi
tata

Merci.
 

4 More Discussions You Might Find Interesting

1. Red Hat

lto4 devices on mpt fusion driver

We are seeing an odd problem on an HP dl380 running Redhat es5 (2.6.18-52+.el5). we have 3 dual channel HBA's with a single tape drive on each channel totaling six tape drives.(2 x lto3, and 4 xlto4). The problem is only a two of the lto-4s are working. At first we thought it might be hardware, but... (0 Replies)
Discussion started by: kolvedic
0 Replies

2. Hardware

Figuring out if Ubuntu will work (completely) with an Acer One (w/ AMD fusion chips)

Hi, I am trying to buy a netbook with Ubuntu pre-installed. I have looked for hours and have not found anything. Calls to Dell, HP, Toshiba have confirmed them NOT selling Ubuntu preloaded laptops. This leads me to look for a netbook that can handle Ubuntu. Getting to the point... I think I... (4 Replies)
Discussion started by: mearex
4 Replies

3. Slackware

compiz-fusion in slackware 13.37?

Has anyone successful runned compiz-fusion in newer slackware version? And how if I may ask? :wall: (0 Replies)
Discussion started by: darkman_hr
0 Replies

4. Fedora

Xrandr on startup - Fedora 19, VMWare Fusion

I've tried following multiple procedures from various sites but can't seem to get this figured out. There was another thread on here about the same thing but I couldn't figure out how to apply it to my situation. This is my first time on Linux so I'm just learning. I am running Fedora 19,... (1 Reply)
Discussion started by: jaykayen
1 Replies
rheostream(2rheolef)						    rheolef-6.1 					      rheostream(2rheolef)

NAME
irheostream, orheostream - large data streams ABSTRACT
This class provides a stream interface for large data management. File decompresion is assumed using gzip and a recursive seach in a directory list is provided for input. orheostream foo("NAME", "suffix"); is like ofstream foo("NAME.suffix"). However, if NAME does not end with `.suffix', then `.suffix' is added, and compression is done with gzip, adding an additional `.gz' suffix. Conversely, irheostream foo("NAME","suffix"); is like ifstream foo("NAME.suffix"). However, we look at a search path environment variable RHEOPATH in order to find NAME while suffix is assumed. Moreover, gzip compressed files, ending with the `.gz' suffix is assumed, and decompression is done. Finally, a set of useful functions are provided. DESCRIPTION
The following code: irheostream is("results", "data"); will recursively look for a `results[.data[.gz]]' file in the directory mentionned by the RHEOPATH environment variable. For instance, if you insert in our ".cshrc" something like: setenv RHEOPATH ".:/home/dupont:/usr/local/math/demo" the process will study the current directory `.', then, if neither `square.data.gz' nor `square.data' exits, it scan all subdirectory of the current directory. Then, if file is not founded, it start recusively in `/home/dupond' and then in `/usr/local/math/demo'. File decompression is performed by using the gzip command, and data are pipe-lined directly in memory. If the file start with `.' as `./square' or with a `/' as `/home/oscar/square', no search occurs and RHEOPATH environment variable is not used. Also, if the environment variable RHEOPATH is not set, the default value is the current directory `.'. For output stream: orheostream os("newresults", "data"); file compression is assumed, and "newresults.data.gz" will be created. File loading and storing are mentionned by a message, either: ! load "./results.data.gz" or: ! file "./newresults.data.gz" created. on the clog stream. By adding the following: clog << noverbose; you turn off these messages (see iorheo(4)). IMPLEMENTATION
class irheostream : public io::filtering_stream<io::input> { public: irheostream() : io::filtering_stream<io::input>() {} irheostream(const std::string& name, const std::string& suffix = std::string()); virtual ~irheostream(); void open (const std::string& name, const std::string& suffix = std::string()); void close(); protected: std::ifstream _ifs; }; class orheostream : public io::filtering_stream<io::output> { public: orheostream() : io::filtering_stream<io::output>() {} orheostream(const std::string& name, const std::string& suffix = std::string()); virtual ~orheostream(); void open (const std::string& name, const std::string& suffix = std::string()); void close(); protected: std::ofstream _ofs; }; std::string itos (std::string::size_type i); std::string ftos (const Float& x); // catch first occurence of string in file bool scatch (std::istream& in, const std::string& ch); // has_suffix("toto.suffix", "suffix") -> true bool has_suffix (const std::string& name, const std::string& suffix); // "toto.suffix" --> "toto" std::string delete_suffix (const std::string& name, const std::string& suffix); // "/usr/local/dir/toto.suffix" --> "toto.suffix" std::string get_basename (const std::string& name); // "/usr/local/dir/toto.suffix" --> "/usr/local/dir" std::string get_dirname (const std::string& name); // "toto" --> "/usr/local/math/data/toto.suffix" std::string get_full_name_from_rheo_path (const std::string& rootname, const std::string& suffix); // "." + "../geodir" --> ".:../geodir" void append_dir_to_rheo_path (const std::string& dir); // "../geodir" + "." --> "../geodir:." void prepend_dir_to_rheo_path (const std::string& dir); bool file_exists (const std::string& filename); // string to float bool is_float (const std::string&); Float to_float (const std::string&); // in TMPDIR environment variable or "/tmp" by default std::string get_tmpdir(); SEE ALSO
iorheo(4) rheolef-6.1 rheolef-6.1 rheostream(2rheolef)
All times are GMT -4. The time now is 07:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy