The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Search, replace string in file1 with string from (lookup table) file2? gstuart Shell Programming and Scripting 9 06-08-2009 07:11 AM
insert file2 after line containing patternX in file1 repudi8or Shell Programming and Scripting 5 04-18-2008 02:35 PM
match value from file1 in file2 myguess21 Shell Programming and Scripting 2 02-21-2008 11:39 AM
Awk Compare f1,f2,f3 of File1 with f1 of File2 RacerX Shell Programming and Scripting 6 11-09-2007 01:34 AM
delete lines from file2 beginning w/file1 michieka Shell Programming and Scripting 13 06-24-2003 02:42 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-16-2008
forumsgr forumsgr is offline
Registered User
  
 

Join Date: Jun 2005
Posts: 3
parsing file2 with input from file1

Sorry dublication with previous thread... please delete it
Hi all

i need and appreciate your help creating a script in ksh for the following case
Two files exists with questionmark delemeter:

File1.txt:
A;B;C;F;D;K;

File2.txt
A,name,address1; K,name,surname,phone; C,name,phone; D,name,address,phone,email; E,surname,phone; F,name,surname; W,name,jobtitle; B,name,address;

The need is to use the File1.txt as input for parsing File2.txt (match line) and produce a File3.txt like below in order to be able to count lines as well:

File3.txt:
A,name,address1;
B,name,address;
C,name,phone;
D,name,address,phone,email;
F,name,surname;
K,name,surname,phone;

Since FILE1.txt and FILE2.txt are hundrens or even thousands of lines, a normal forloop would crash the system or would take ages to be completed in serial way.

BR
CJ

Last edited by forumsgr; 07-16-2008 at 06:29 AM..
  #2 (permalink)  
Old 07-16-2008
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,128
Pls don't double-post - read the forums rules.
Thread closed!
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0