07-15-2018
By just looking at your new files, it can be seen that your desired output is impossible to achieve. b.txt is not in file2 so no match will be found for it. No need to do a test run.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hello
have a file1
H87I
Y788O
T347U
J23U
and
file2 J23U U887Y I99U T556U
file3 I99O J99T F557J
file4 N99I T666U R55Y
file5 H87I T347U
file6 H77U R556Y E44T
file7 Y788O K98U H8I
May be using script we can use file1 to search for all the files
and have the output
H87I file5... (3 Replies)
Discussion started by: cdfd123
3 Replies
2. Shell Programming and Scripting
Hi guys,
firstly I'm working on SunOS 5.10 Generic_125100-10 sun4u sparc SUNW,Sun-Fire-V240
I've made a script to compress two directory and then send them to an other server via ftp. This is working very well.
Inside theis script I decide to log usefull data for troubleshooting in case of... (7 Replies)
Discussion started by: moustik
7 Replies
3. UNIX for Dummies Questions & Answers
Give shell script....which takes two file names as input and compares the contents, is both are same delete second file's contents.....
I try with "diff"...... but confusion how to use "diff" with if ---else
Thanking you (5 Replies)
Discussion started by: krishnampkkm
5 Replies
4. Shell Programming and Scripting
Hello
Has anyone got an example shell script that I can use to compare the contents of two files.
The files should contain the same contents, eg.
file1.txt
apple
pear
grape
file2.txt
apple
pear
grape (2 Replies)
Discussion started by: deedaz
2 Replies
5. UNIX for Advanced & Expert Users
All,
PLease can you help me with a shell script which can compare two xml files and print the difference to a output file.
I have attached one such file for you reference.
<Group>
<Member ID=":Year_Quad:41501" childCount="4" fullPath="PEPSICO Year-Quad-Wk : FOLDER.52 Weeks Ending Dec... (2 Replies)
Discussion started by: kanthrajgowda
2 Replies
6. Shell Programming and Scripting
Hi All,
Need help on this
I have 2 files
one file file1 which has several entries as :
define service{
hostgroup_name !host1,!host5,!host6,.*
service_description check_nrpe
}
define service{
hostgroup_name !host2,!host4,!host6,.*
service_description check_opt
}
another... (2 Replies)
Discussion started by: namitai
2 Replies
7. Shell Programming and Scripting
Hi Friends,
I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving...
File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Discussion started by: asnandhakumar
6 Replies
8. Shell Programming and Scripting
So I'm stumped.
First... APOLOGIES... my work is offline in an office that has zero internet connectivity, as required by our client. If need be, I could print out my script attempts and retype them here. But on the off chance... here goes.
I have a text file (file_source) of terms, each line... (3 Replies)
Discussion started by: Brusimm
3 Replies
9. UNIX for Beginners Questions & Answers
I am trying to consolidate multiple information files (<hostname>.Linux.nfslist) into one file so that I can import it into Excel. I can get the file contents with cat *Linux.nfslist >> nfslist.txt. I need each line prefaced with the hostname. I am unsure how to do this.
--- Post updated at... (5 Replies)
Discussion started by: Kentlee65
5 Replies
10. UNIX for Beginners Questions & Answers
Like to have shell script to Read the given file contents into a merged one file with header of path+file name followed by file contents into a single output file.
While reading and merging the file contents into a single file, Like to keep the format of the source file.
... (4 Replies)
Discussion started by: Siva SQL
4 Replies
trcs(1) User Manuals trcs(1)
NAME
trcs - convert text files from one codeset to other
SYNOPSIS
trcs -C | -l | -h
trcs [-s] [-f input-codeset ] [-t output-codeset ] [ file ]...
DESCRIPTION
trcs is a program for translation of text files from one codeset to other. When exact translation is impossible it tries to make approxi-
mations. For example pseudographic characters are approximated by ASCII characters in codesets that have no pseudographic characters and
characters with diacritical marks are approximated by existing characters.
If the option -s or --gen-script is given trcs will generate simple script that invokes tr(1) This is useful if you want to include this in
your script or for faster conversion of many files.
If none of -C, -s, -l, -h and their equivalents is given each file will be read assuming it is coded with codeset input-codeset On standard
output it will be recoded so to use codeset output-codeset If there is no file given trcs will act as filter. Both input-codeset and out-
put-codeset are case insensitive and default to `cp1251'.
OPTIONS
-C, --copyright
Display copying conditions and warranty information.
-s, --gen-script
Generates conversion script for given input and output encodings instead to convert text files.
-l, --list
List all known codesets with their aliases.
-h, --help
Display this help and exit.
-f input-codeset, --from[=]input-codeset
Codeset of the source.
-f output-codeset, --to[=]output-codeset
Codeset of the output.
EXAMPLES
trcs -fcyrillic -t koi8-r letter.txt
Convert letter.txt from ISO-8859-5 (cyrillic) to KOI8-R and output the result on standard output.
trcs --from cp437 --to=mik --gen-script >ibm2mik
Generates script ibm2mik for converting from CP437 to MIK.
sh ibm2mik screen.txt
Convert screen.txt from CP437 to MIK. Output the result on standard output. Without parameters ibm2mik acts as filter.
AUTHOR
Anton Zinoviev <anton@lml.bas.bg>, <zinoviev@fmi.uni-sofia.bg>
SEE ALSO
tr(1)
Linux JUN 2000 trcs(1)