pick columns


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting pick columns
# 1  
Old 11-02-2010
pick columns

I want to be able pick columns from 2 files with similar reference data:

File 1

Code:
Last NameFirst NameSalaryCityDunnJohn $42,000.00 ChicagoGrantSuzy $95,000.00 GaryLoweMike $80,000.00 MilwaukeeGrantMike $59,000.00 JolietLoweKaren $48,000.00 South Bend

File 2

Code:
TitleFirst NameLast NameStateVPMikeGrantIllinoisEVPKarenLoweIndianaAVPJohnDunnIllinoisCEOSuzyGrantIndianaCFOMikeLoweWisconsin

I would like for example

Code:
First NameLast NameCityStateMikeGrantJolietIllinoisKarenLoweSouth BendIndianaJohnDunnChicagoIllinoisSuzyGrantGaryIndianaMikeLoweMilwaukeeWisconsin

THis is with requirement the names in the 1st 2 columns stay associcated with each other. First name and Last name need to be correctly associated.

Last edited by radoulov; 11-02-2010 at 01:25 PM.. Reason: Code tags, please!
# 2  
Old 11-02-2010
Could you confirm that the posted example reflects you real data format?
What have you tried so far?
# 3  
Old 11-02-2010
More specifically

5 columns in file 1
11 columns in file 2
file 1 has more lines than file 2
cols 1, 2, 4, 5, 6, 7 match info between the two files

based on the matching cols (1,2,4,5, 6,7) to only record count of file 2 i want to extract cols 3,5 from file 1 and merge them with file 2
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pick systems

looking for any advise on how to export Pick data from an AIX implementation. i have someone with limited experience that knows how to create a text file from a pick database. (1 Reply)
Discussion started by: jgt
1 Replies

2. Filesystems, Disks and Memory

Clustered filesystem which one to pick

Hi all, I'm a bit new to advanced filesystem types. I've just only learned that if you wish to share a single fibre channel extent with many servers you need to use a clustered filesystem to prevent data corruption. looking through a list of clustered file systems I saw gfs2 which I thought... (1 Reply)
Discussion started by: jokken
1 Replies

3. Shell Programming and Scripting

Need to pick max values of the columns

Hi, I have sar disk reports like below sample: 01:01:00 hdisk24 0 0.0 0 0 0.0 0.0 hdisk15 0 0.0 0 3 0.0 5.5 hdisk20 0 0.0 2 1 0.0 1.9 hdisk19 1 ... (3 Replies)
Discussion started by: reddyr
3 Replies

4. UNIX for Dummies Questions & Answers

Pick out columns according to list of column names

Hi Everyone: I'm new to linux and I was wondering what the best way to approach the following problem was. I have 2 files: File A: ID123 ID234 ID456 File B: ID123 ID234 ID345 ID456 A B C D E F G H I J K L Based on the list of IDs in File A, I want to output only the... (3 Replies)
Discussion started by: chongm88
3 Replies

5. Shell Programming and Scripting

Pick and print

Hi Friends, I'm facing an issue. I am having a file as under : a1 b1 c1 a2 a3 a4 b4 a5 b5 and I need to get the output as under: a1 b1 a4 b4 a5 b5 i.e. to pick the columns where a and b are consecutive and ignoring rest. I was trying some thing sily as: (2 Replies)
Discussion started by: vanand420
2 Replies

6. Shell Programming and Scripting

Pick one file from each subdirectory

Hi, I have a problem I am trying to solve with bash. I need to search in a file system (data base) with hundreds of directories and thousands of subdirectories and millions of files. The files have a specific format with a header that gives the properties. Directories are organized so... (1 Reply)
Discussion started by: majest
1 Replies

7. Shell Programming and Scripting

need to pick out files which are not of zero bytes

I need a scriptto print only those files from a list of files starting with STMT* which are not of zero bytes ...i.e they have some size if these are the files 631 -rw-r--r-- 1 assrisa assrisa 39099 Aug 19 07:16 STMT_05_D1090819_T071320 -rw-r--r-- 1 assrisa assrisa 0 Aug 19... (2 Replies)
Discussion started by: viv1
2 Replies

8. Shell Programming and Scripting

Pick the exact value

Hi, How do i pick a particular value from a group of lines using python. for instance from the below sample. How do I pick Value=1 of OuterLines=1 and InnerLine=1 (11 Replies)
Discussion started by: ahmedwaseem2000
11 Replies

9. UNIX for Dummies Questions & Answers

how to pick distinct records..........

How can i pick distinct records which consists of duplicate data from a ASCII file using UNIX commands (3 Replies)
Discussion started by: ss4u
3 Replies

10. Solaris

Please help me pick a machine

Hey guys I am new here and like this forum alot. I went to get into Solaris and would like to buy a sun box on ebay. NON rackmount. Problem is there is so many diff types. I am looking for one under the $800 range that can support solaris 10 and have the basics and decent ram. Can you guys... (11 Replies)
Discussion started by: Gnfanatic
11 Replies
Login or Register to Ask a Question