Sponsored Content
Top Forums Shell Programming and Scripting Need shell script to read two file at same time and print out in single file Post 302295389 by sreedhargouda on Saturday 7th of March 2009 07:02:47 PM
Old 03-07-2009
Data Need shell script to read two file at same time and print out in single file

Need shell script to read two file at same time and print output in single file


Example I have two files 1) file1.txt 2) file2.txt

File1.txt contains

Aaa
Bbb
Ccc
Ddd
Eee
Fff


File2.txt contains

Zzz
Yyy
Xxx
www
vvv
uuu


I need output file like output.txt

Aaa
Zzz
-----
Bbb
Yyy
----
Ccc
Xxx
----
Ddd
www


please help me any one Smilie


 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

why shell scripting takes more time to read a file

i have done a coding in shell scripting which reads a file line by line and does something....it takes more than 30 seconds to execute for a single file. when i do the same with perl scripting it takes less than a second. is that shell scripting is not efficient while working with large number of... (1 Reply)
Discussion started by: brkavi_in
1 Replies

2. Shell Programming and Scripting

search for the contents in many file and print that file using shell script

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

3. Shell Programming and Scripting

Read Oracle Username password SID from single file and pass it to shell

Dear All I am trying to write one shell which will be running through Cron which contain one SQL query. But I want to draw/fetch the Username password and Instance name (required to loging to the database) from one single file to run that SQL query . Also this file contain details of multiple... (2 Replies)
Discussion started by: jhon
2 Replies

4. Shell Programming and Scripting

script to read the contents of a file and print

Hi, Need help in writing a script to read the contents of this file test Test 00a 00b 00c 00d 00e 00f where it need to read each line to give a display such as form meta from dev 00a , config=Striped; add dev 00b:00f to meta 00a Can any one help me in writing this script (2 Replies)
Discussion started by: praveen1516
2 Replies

5. Shell Programming and Scripting

Shell script to read file and check file type

Hi, I have a file with few values in it. I need script help to read file line by line and check: 1/if it's a file (with extension eg .java .css .jar etc ) or 2/if it's a file without extension and treat it as a directory and then check if the directory exists in working copy else create one... (6 Replies)
Discussion started by: iaav
6 Replies

6. Shell Programming and Scripting

Shell script to read specified value from file and echo to the same location to other file.

Hello. I want to to backup some "default:" values from a file do some other job and after restore that "default:" values back. The problem is that the source and destination file has a lot of default: strings in it but with different values... So.. Here is an example: A part of my source... (6 Replies)
Discussion started by: ausdim
6 Replies

7. UNIX for Dummies Questions & Answers

Reading XML file and print the values in the text file using Linux shell script

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (1 Reply)
Discussion started by: sravanreddy
1 Replies

8. UNIX for Beginners Questions & Answers

Shell Script to Read the given file contents into a merged one file

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

9. UNIX for Beginners Questions & Answers

Creating script to read many files and load into database via single control file

Hi, I have many files but with only 2 names , I want to load the data of that file into database through sqlldr with single control file. how can i do that ????? Example: switch_file switch_file billing_file billing_file now these files should be loaded into same database but different... (1 Reply)
Discussion started by: niti_sharma
1 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)
All times are GMT -4. The time now is 11:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy