Sponsored Content
Top Forums Shell Programming and Scripting Need script to take input from file, match on it in file 2 and input data Post 302367746 by darkoth on Tuesday 3rd of November 2009 10:40:36 AM
Old 11-03-2009
Need script to take input from file, match on it in file 2 and input data

All,

I am trying to figure out a script to run in windows that will allow me to match on First column in file1 to 8th Column in File2 then
Insert file1 column2 to file2 column4 then create a new file.

File1:
12345 Sam
12346 Bob
12347 Bill

File2:
Modify|Samuel|Smith||US|Indianapolis|23|12345
Modify|Robert|Smiley||US|Indianapolis|23|12346
Modify|William|Butterworth||US|Indianapolis|23|12347

So once matched and inserted new file would contain:
Modify|Samuel|Smith|Sam|US|Indianapolis|23|12345|...
Modify|Robert|Smiley|Bob|US|Indianapolis|23|12346
Modify|William|Butterworth|Bill|US|Indianapolis|23|12347

Can I do this in perl or do I need to do it somewhere else?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help to write a script or program to automatic execute and link input file data

Output file template format <input_file_name>a</input_file_name> <total_length_size>b</total_length_size> <log_10_length_size>c</log_10_length_size> Input_file_1 (eg. sample.txt) SDFSDGDGSFGRTREREYWW Parameter: a is equal to the input file name b is equal to the total length of... (2 Replies)
Discussion started by: perl_beginner
2 Replies

2. Shell Programming and Scripting

split input data file and put into same output file

Hi All, I have two input file and need to generate a CSV file. The existing report just "GREP" the records with the Header and Tailer records with the count of records. Now i need to split the data into 25 records each in the same CSV file. id_file (Input file ) 227050994 232510151... (4 Replies)
Discussion started by: rasmith
4 Replies

3. Shell Programming and Scripting

List all file that match user input perl

Hi, I want to list all file that match user input ( specified shell wildcard) but when I compile it dont list me #!/usr/bin/perl -w print "Enter Advance Search Function: "; chomp ($func = <STDIN>); my @files = glob("$func"); foreach my $file (@files) { print "$file\n";... (1 Reply)
Discussion started by: guidely
1 Replies

4. Shell Programming and Scripting

adding data in input file if 2nd script output SUCCESS

Hi All, how can i edit my original data and add more data if my 2nd script outputs SUCESS? ex. input file: 1.txt nik,is,the 1script.sh if 2ndscript.sh output SUCCESS then i'm going to edit my input file and add data best,pogi.. sample outputdata. nik,is,the,best,pogi 2ndscript.sh... (3 Replies)
Discussion started by: nikki1200
3 Replies

5. Shell Programming and Scripting

Match string from two file input

Hello all, I have file like this: file 1: aa bb cc dd ee file2: 111 111 111 111 111 111 (2 Replies)
Discussion started by: attila
2 Replies

6. Shell Programming and Scripting

Script to delete files with an input for directories and an input for path/file

Hello, I'm trying to figure out how best to approach this script, and I have very little experience, so I could use all the help I can get. :wall: I regularly need to delete files from many directories. A file with the same name may exist any number of times in different subdirectories.... (3 Replies)
Discussion started by: *ShadowCat*
3 Replies

7. UNIX for Dummies Questions & Answers

Inserting shell script input data automatically from a text file

Dear experts, I am new to linux programming. I have a shell script which i should run it on all my samples. I only define input and out put for this script. The inputs are 3 numbers(coordination numbers) which are available in a series of text file. Since i have a lots of samples, it takes a... (5 Replies)
Discussion started by: mohamadreza
5 Replies

8. Shell Programming and Scripting

Input file needs to match a column and print the entire line

I have a file with class c IP addresses that I need to match to a column and print the matching lines of another file. I started playing with grep -if file01.out file02.out but I am stuck as to how to match it to a column and print the matching lines; cat file01.out 10.150.140... (5 Replies)
Discussion started by: lewk
5 Replies

9. Shell Programming and Scripting

awk to reformat output if input file is empty, but not if file has data in it

The below awk improved bu @MadeInGermany, works great as long as the input file has data in it in the below format: input chrX 25031028 25031925 chrX:25031028-25031925 ARX 631 18 chrX 25031028 25031925 chrX:25031028-25031925 ARX 632 14... (3 Replies)
Discussion started by: cmccabe
3 Replies

10. Shell Programming and Scripting

How to get the shell script to read the .txt file as an input/data?

i have written my shell script in notepad however i am struggling to pass the data file to be read to the script the data file is of .txt format. My target is to run the shell script from the terminal and pass 3 arguments e.g. polg@DESKTOP-BVPDC5C:~/CS1420/coursework$ bash valsplit.sh input.txt... (11 Replies)
Discussion started by: Gurdza32
11 Replies
mfontset_modify_entry(3m17n)					 The m17n Library				      mfontset_modify_entry(3m17n)

NAME
mfontset_modify_entry - Modify the contents of a fontset. SYNOPSIS
int mfontset_modify_entry (MFontset * fontset, MSymbol script, MSymbol language, MSymbol charset, MFont * spec, MSymbol layouter_name, int how) DESCRIPTION
Modify the contents of a fontset. The mfontset_modify_entry() function associates, in fontset fontset, a copy of font with the script / language pair or with charset. Each font in a fontset is associated with a particular script/language pair, with a particular charset, or with the symbol Mnil. The fonts that are associated with the same item make a group. If script is not Mnil, it must be a symbol identifying a script. In this case, language is either a symbol identifying a language or Mnil, and font is associated with the script / language pair. If charset is not Mnil, it must be a symbol representing a charset object. In this case, font is associated with that charset. If both script and charset are not Mnil, two copies of font are created. Then one is associated with the script / language pair and the other with that charset. If both script and charset are Mnil, font is associated with Mnil. This kind of fonts are called fallback fonts. The argument how specifies the priority of font. If how is positive, font has the highest priority in the group of fonts that are associated with the same item. If how is negative, font has the lowest priority. If how is zero, font becomes the only available font for the associated item; all the other fonts are removed from the group. If layouter_name is not Mnil, it must be a symbol representing a mdbFLT (font layout table). In that case, if font is selected for drawing an M-text, that font layout table is used to generate a glyph code sequence from a character sequence. RETURN VALUE
If the operation was successful, mfontset_modify_entry() returns 0. Otherwise it returns -1 and assigns an error code to the external variable merror_code. ERRORS
MERROR_SYMBOL COPYRIGHT
Copyright (C) 2001 Information-technology Promotion Agency (IPA) Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST) Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>. Version 1.6.2 12 Jan 2011 mfontset_modify_entry(3m17n)
All times are GMT -4. The time now is 02:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy