Sponsored Content
Top Forums Shell Programming and Scripting Selecting Specific Columns and Insert the delimiter TAB Post 302547016 by birei on Saturday 13th of August 2011 06:06:59 AM
Old 08-13-2011
Hi,

Use 'split' to save all columns in an array and select them by index:
Code:
@fields = split /\|/, $_;

Code:
print join( "\t", @fields[1, 3, 6 .. 10, 12] ), "\n";

Regards,
Birei
This User Gave Thanks to birei For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cutting a tab delimiter file

I have a 30 column tab delimited record file. I need to extract the first 10column. The following command to cut was not working cut -f 1-10 -d "\t" filename. Could any one keep on this . Thanks in Advance (4 Replies)
Discussion started by: vinod.thayil
4 Replies

2. Shell Programming and Scripting

how to differentiate columns of a file in perl with no specific delimiter

Hi everybody, This time I am having one issue in perl. I have to create comma separated file using the following type of information. The problem is the columns do not have any specific delimiter. So while using split I am getting different value. Some where it is space(S) and some where it is... (9 Replies)
Discussion started by: Amiya Rath
9 Replies

3. Shell Programming and Scripting

append data in a file by using tab delimiter

Hi, I need to append the data in to a file by using tab delimiter. eg: echo "Data1" >> filename.txt echo "\t" >> filename.txt (its not working) echo "Data2" >> filename.txt. the result sould be like this. Data1 Data2 (6 Replies)
Discussion started by: Sharmila_P
6 Replies

4. UNIX for Advanced & Expert Users

how to search delimiter tab in a line and replace it

hi every one plz help me i want to search for a line contains tabspace This is a line The should be changed see the above line is seperated with tab space i want to replace that tab space in to # as This is a line#The should be changed i have tried with... (4 Replies)
Discussion started by: kkraja
4 Replies

5. UNIX for Dummies Questions & Answers

Delimiter: Tab or Space?

Hello, Is there a direct command to check if the delimiter in your file is a tab or a space? And how can they be converted from one to another. Thanks, G (4 Replies)
Discussion started by: Gussifinknottle
4 Replies

6. Shell Programming and Scripting

Selecting specific 'id's from lines and columns using 'SED' or 'AWK'

Hello experts, I am new to this group and to 'SED' and 'AWK'. I have data (text file) with 5 columns (C_1-5) and 100s of lines (only 10 lines are shown below as an example). I have to find or select only the id numbers (C-1) of specific lines with '90' in the same line (of C_3) AND with '20' in... (6 Replies)
Discussion started by: kamskamu
6 Replies

7. UNIX for Dummies Questions & Answers

Making a Tab delimiter file to Comma

How can i make a tab delimiter file to a comma delimiter??? (13 Replies)
Discussion started by: saggiboy10
13 Replies

8. Shell Programming and Scripting

Compare two tab-delimiter files

Hi, I have two files like: file1 chr1 40 chr1 50 chr2 10 chr2 60 file2 chr1 30 chr1 50 chr2 15 chr2 20 and want to get the difference of column 2 when column 1 is the same in both files. (4 Replies)
Discussion started by: linseyr
4 Replies

9. Shell Programming and Scripting

Insert space in specific column among many columns

Hello, I have some problem in inserting the space for the pairs of columns. I have the input file : I used this code below in replacing it using space in specific column (replace space in each two columns) sed -e "s/,/ /2" -e "s/,/ /3" inputfile Output showed : However, I have many... (3 Replies)
Discussion started by: awil
3 Replies

10. Shell Programming and Scripting

Delete and insert columns in a tab delimited file

Hi all , I have a file having 12 columns tab delimited . I need to read this file and remove the column 3 and column 4 and insert a word in column 3 as "AVIALABLE " Is there a way to do this . I am trying like below Thanks DJ cat $FILENAME|awk -F"\t" '{ print $1 "\t... (3 Replies)
Discussion started by: Hypesslearner
3 Replies
MLDONKEY_FILES(1)						  [FIXME: manual]						 MLDONKEY_FILES(1)

NAME
mldonkey_files - a files source filter for mlnet init file. SYNOPSIS
mldonkey_files {[--join] | [--split network_name] | [--test network_name]} [-f0 file] [-f1 file] [-f2 file] [-q] DESCRIPTION
This manual page documents briefly the mldonkey_files command. This manual page was written for the Debian GNU/Linux distribution because the original program is Debian GNU/Linux specific. This script was written by the debian developer to permit smoother transition to mldonkey without fasttrack support. MLDonkey suffer from a fasttrack file GPL-problematic. The support of fasttrack has been removed from the upstream source. -f0 file This option is needed. First part of the tri term split/join expression -f1 file This option is needed. Second part of the tri term split/join expression -f2 file This option is needed. Third part of the tri term split/join expression --join This command will merge -f1 and -f2 into file -f0. Be warned that no confirmation will be asked. -f0 will be erased. --split network_name This command will separate file source entry concerning the network network_name from the -f0 file and the rest. The entry concerning network_name will be put in -f1 file, the rest in -f2 file. Be warned that no confirmation will be asked. -f1 and -f2 files will be erased. --test network_name This command will search file source entry concerning the network network_name in the -f0 file. If one file comes from the given network, the exit code will be 0 else 1. -q Quiet mode. Actions --split, --test and --join are exclusive. You can only perform one at the same time. LICENSE
This manual page was originally written by Sylvain Le Gall gildor@debian.org for the Debian GNU/Linux system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Lesser General Public License, Version 2.1 or any later version published by the Free Software Foundation; considering as source code all the file that enable the production of this manpage. SEE ALSO
mlnet (1) /usr/share/doc/mldonkey-server/README.Debian AUTHORS
Sylvain Le Gall <gildor@debian.org> Author. Mehdi Dogguy <dogguy@pps.jussieu.fr> Author. COPYRIGHT
Copyright (C) 2003, 2004, 2005, 2006 Sylvain Le Gall Copyright (C) 2009 Mehdi Dogguy [FIXME: source] Mar 14, 2009 MLDONKEY_FILES(1)
All times are GMT -4. The time now is 06:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy