Sponsored Content
Full Discussion: read from different files
Top Forums Shell Programming and Scripting read from different files Post 302415827 by tomjones on Friday 23rd of April 2010 12:22:54 PM
Old 04-23-2010
read from different files

i have the following files with content

file a content;

Code:
1234|wert|

file b content;

Code:
2345|byte|

file c content;
Code:
9999|kilo|

i want to read the contents of three files seperately and for each of them select the first column and output below

Code:
welcome 1234
welcome 2345
welcome 9999


Last edited by vgersh99; 04-23-2010 at 02:07 PM.. Reason: code tags, please!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to read from two files

Hi This works almost as I wish, but not exatly: for i in `cat names.log`; do grep $i combined2.log | awk '{print $8}' | grep $i | sort -u | head -8 ;done This works with 8 lines for each pattern in names.log file. But i need to read number of lines from second file, say count.log. I've... (3 Replies)
Discussion started by: jos
3 Replies

2. UNIX for Dummies Questions & Answers

read and drop files

I have hundreds of small files in csv format. I want to read them one at a time, insert the data into a table and then delete it. data1 to data999.txt files needs to be read and data to be added to a table. mysql -e"LOAD DATA INFILE 'data1.txt' INTO TABLE my_table;" if echo $? = 0 then rm... (1 Reply)
Discussion started by: shantanuo
1 Replies

3. UNIX for Dummies Questions & Answers

read files from subdirectories

hello there the problem i got: i need to list .rrd files in each sub-directory from the parent directory, then create .xml files for each rrd files, the xml file should be in the same subdirectoryas rrd file. i have tried ls |awk '{print... (3 Replies)
Discussion started by: binbintriangel
3 Replies

4. Shell Programming and Scripting

how do I read from two files

Hi All, I would like to read the contents of two files using a loop but it doesn't seem to be working. Please have a look at the following script and help me resolve the problem. While read Rec, Rec1 do echo $Rec echo $Rec1 --- ---- --- done < file1, file2 I also tried this ... (8 Replies)
Discussion started by: tommy1
8 Replies

5. UNIX for Dummies Questions & Answers

Read only files for all users

Here my problem. As a root i created a file, and added the content to the file. Now i want to make this file as read only file for all the user including root. Some how i need to protect this file from all users.I tried using the sticky bit. It works for directories. Do any one have idea how to... (8 Replies)
Discussion started by: k.ganesh
8 Replies

6. UNIX for Advanced & Expert Users

read() wont allow me to read files larger than 2 gig (on a 64bit)

Hi the following c-code utilizing the 'read()' man 2 read method cant read in files larger that 2gig. Hi I've found a strange problem on ubuntu64bit, that limits the data you are allowed to allocate on a 64bit platform using the c function 'read()' The following program wont allow to allocate... (14 Replies)
Discussion started by: monkeyking
14 Replies

7. AIX

read nmon files

Hi. I have a cron job running nmon -X & collecting info into the files nmon.$month$date. Files owned by root ( as the job owner ) . What is the best way to make them automatically readable for everyone. The files stored in the folder bash-3.2$ ls -ld /system_performance/nmon_logs drwxrwxrwx 2... (2 Replies)
Discussion started by: sashaney
2 Replies

8. Shell Programming and Scripting

How to read log files from last read

Hi i am looking a way to look at a log file(log.txt) from the last time I've read it. However after some days the main log file(log.txt) is rename to (log.txt.1). So now i will have two log files as below. log.txt.1 log.txt Now, i have to read the log from the point where i have left... (3 Replies)
Discussion started by: sumitsks
3 Replies

9. Shell Programming and Scripting

While Read Two Files

I am trying to read two files in a while loop. It never runs, any thoughts would be most appreciated. cat /tmp/trueclients.lst | while read CLIENT cat /tmp/dates.lst | while read DATES while read CLIENT do while read DATES do /usr/openv/netbackup/bin/admincmd/bpimagelist -L... (2 Replies)
Discussion started by: JGM22
2 Replies

10. Shell Programming and Scripting

Read files in shell script code and run a C program on those files

HI, I am trying to implement a simple shell script program that does not make use of ls or find commands as they are quite expensive on very large sets of files. So, I am trying to generate the file list myself. What I am trying to do is this: 1. Generate a file name using shell script, for... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies
Locale::Codes::LangFam(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangFam(3pm)

NAME
Locale::Codes::LangFam - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangFam; $lext = code2langfam('apa'); # $lext gets 'Apache languages' $code = langfam2code('Apache languages'); # $code gets 'apa' @codes = all_langfam_codes(); @names = all_langfam_names(); DESCRIPTION
The "Locale::Codes::LangFam" module provides access to standard codes used for identifying language families, such as those as defined in ISO 639-5. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 639-5 language family codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language families. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langfam('apa','alpha'); $lext = code2langfam('apa',LOCALE_LANGFAM_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from ISO 639-5 such as 'apa' for Apache languages. This is the default code set. ROUTINES
code2langfam ( CODE [,CODESET] ) langfam2code ( NAME [,CODESET] ) langfam_code2code ( CODE ,CODESET ,CODESET2 ) all_langfam_codes ( [CODESET] ) all_langfam_names ( [CODESET] ) Locale::Codes::LangFam::rename_langfam ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangFam::add_langfam ( CODE ,NAME [,CODESET] ) Locale::Codes::LangFam::delete_langfam ( CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_alias ( NAME ,NEW_NAME ) Locale::Codes::LangFam::delete_langfam_alias ( NAME ) Locale::Codes::LangFam::rename_langfam_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::delete_langfam_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.loc.gov/standards/iso639-5/id.php ISO 639-5 . AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2013 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2013-11-04 Locale::Codes::LangFam(3pm)
All times are GMT -4. The time now is 08:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy