Sponsored Content
Top Forums Shell Programming and Scripting Filtering issues with multiple columns in a single file Post 302471134 by crunchie on Friday 12th of November 2010 04:47:54 AM
Old 11-12-2010
Filtering issues with multiple columns in a single file

Hi,

I am new to unix and would greatly appreciate some help.

I have a file containing multiple colums containing different sets of data e.g.

File 1:

John Ireland 27_December_69
Mary England 13_March_55
Mike France 02_June_80

I am currently using the awk command to filter the first 2 columns to one file and the third column to another file e.g.

File 1:

John Ireland
Mary England
Mike France

File 2:

December
March
June


I then use the "paste" command to merge the data from both files so i get the following:

File 3:
John Ireland December
Mary England march
Mike France June


Is there a way to filter all the data to a single file and not to 2 seperate files. I am thinking of using the sed command but im not too sure.

If ive made anything unclear please reply and ill try to explain it better.

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Filtering multiple entries in a file

Hi, I have a requirement to filter multiple entries in a text file. Entries are a pair of 2 lines .Like line1 line2 ....... ........ Here line1, line2 consist of one pair. line1 and line2 contain different data. There can be multiple entries for the same pair. And there can be 'n' such... (2 Replies)
Discussion started by: suman_jakkula
2 Replies

2. UNIX for Dummies Questions & Answers

single column to multiple columns

Hello, I have a single column of data that I would like to cut/print (with awk or ...) into multiple columns at every empty row (or common character). Input: 5.99123 5.94693 7.21383 5.95202 0.907935 5.99149 6.08427 0.975774 6.077 Output: 5.99123 5.95202 6.08427 5.94693... (7 Replies)
Discussion started by: agibbs
7 Replies

3. Shell Programming and Scripting

Single column to multiple columns in awk

Hi - I'm new to the awk programming language. I'm trying to print a single column of data to several columns, and I found an article on iTWorld.com (ITworld.com - Printing in columns). It looks like the mkCols2 script is very close to what I need to do, but it looks like the end of the code... (2 Replies)
Discussion started by: astroDave
2 Replies

4. Shell Programming and Scripting

Filtering Multiple variables from a single column

Hi, I am currently filtering a file, "BUILD_TIMES", that has multiple column of information in it. An example of the data is as follows; Fri Nov 5 15:31:33 2010 00:28:17 R7_BCGNOFJ_70.68 Fri Nov 5 20:57:41 2010 00:07:21 R7_ADJCEL_80.6 Wed Nov 10 17:33:21 2010 00:01:13 R7_BCTTEST3_80.1X... (7 Replies)
Discussion started by: crunchie
7 Replies

5. Shell Programming and Scripting

Multiple columns to a single column

I have this input: 10 22 1 100 11 22 10 1 50 14 3 1 100 23 3 1 100 24 15 1 100 10 22 5 3 1 33.333 11 22 1 100 It has an inconsistent number of fields but the last field is determined by 100/(NF-2) using awk. I want to take this multiple columned input file and transform so that... (2 Replies)
Discussion started by: mdlloyd7
2 Replies

6. Shell Programming and Scripting

Awk match multiple columns in multiple lines in single file

Hi, Input 7488 7389 chr1.fa chr1.fa 3546 9887 chr5.fa chr9.fa 7387 7898 chrX.fa chr3.fa 7488 7389 chr21.fa chr3.fa 7488 7389 chr1.fa chr1.fa 3546 9887 chr9.fa chr5.fa 7898 7387 chrX.fa chr3.fa Desired Output 7488 7389 chr1.fa chr1.fa 2 3546 9887 chr5.fa chr9.fa 2... (2 Replies)
Discussion started by: jacobs.smith
2 Replies

7. Shell Programming and Scripting

break from a single list into multiple columns

Hi Guys, I am prety new to the hell scripting world. I am running some grep/cut commands and extracting from a csv file into a list. But the final product I need is that the whole list that I now have has to be broken and separated into columns. Say what I now have extracted is a list of... (6 Replies)
Discussion started by: h_rishi
6 Replies

8. Shell Programming and Scripting

Filtering first file columns based on second file column

Hi friends, I have one file like below. (.csv type) SNo,data1,data2 1,1,2 2,2,3 3,3,2 and another file like below. Exclude data1 where Exclude should be treated as column name in file2. I want the output shown below. SNo,data2 1,2 2,3 3,2 Where my data1 column got removed from... (2 Replies)
Discussion started by: ks_reddy
2 Replies

9. Shell Programming and Scripting

Shell scripting - need to arrange the columns from multiple file into a single file

Hi friends please help me on below, i have 5 files like below file1 is x 10 y 20 z 15 file2 is x 100 z 245 file3 is y 78 z 23 file4 is x 100 (3 Replies)
Discussion started by: siva kumar
3 Replies

10. Shell Programming and Scripting

Combining columns from multiple files into one single output file

Hi, I have 3 files with one column value as shown File: a.txt ------------ Data_a1 Data_a2 File2: b.txt ------------ Data_b1 Data_b2 Data_b3 Data_b4 File3: c.txt ------------ Data_c1 Data_c2 Data_c3 Data_c4 Data_c5 (6 Replies)
Discussion started by: vfrg
6 Replies
GNUPOD_INIT(1)							   User Commands						    GNUPOD_INIT(1)

NAME
gnupod_INIT - prepares a 'virgin' iPod for GNUpod SYNOPSIS
gnupod_INIT [OPTION]... DESCRIPTION
Prepares a 'virgin' iPod for GNUpod --help display this help and exit --version output version information and exit -m, --mount=DIRECTORY iPod mountpoint. Note, gnupod_INIT ignores $IPOD_MOUNTPOINT -d, --disable-convert Don't try to convert an existing iTunesDB (Only for experts) -f, --france Create IPOD_MOUNTPOINT/iPod_Control/Device/Limit. This File tells iPods with Firmware 1.x to limit the Volume to 100dB (EU/France law...). Firmware 2.x ignores this File. (But you can use the --volume switch of mktunes.pl) AUTHOR
Written by Adrian Ulrich REPORTING BUGS
Report bugs to <bug-gnupod@nongnu.org> COPYRIGHT
Copyright (C) Adrian Ulrich This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
The full documentation for gnupod is maintained as a Texinfo manual. If the info program and GNUpod are properly installed at your site, the command info gnupod should give you access to the complete manual. gnupod_INIT 1.00 June 2005 GNUPOD_INIT(1)
All times are GMT -4. The time now is 07:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy