extracting columns with awk

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting extracting columns with awk
# 15  
Old 09-14-2009
I only wish i was as sharp as u guys.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Joining files using awk not extracting all columns from File 2

Hello All I'm joining two files using Awk by Left outer join on the file 1 File 1 1 AA 2 BB 3 CC 4 DD File 2 1 IND 100 200 300 2 AUS 400 500 600 5 USA 700 800 900 (18 Replies)
Discussion started by: venkat_reddy
18 Replies

2. Shell Programming and Scripting

Extracting multiple columns with awk

Hi everyone!! I need to apply a simple command to extract columns from a matrix, but I need to extract contemporary from the first to the tenth columns, than from the eleventh to the twentyth and so on... how can i do that? (1 Reply)
Discussion started by: gabrysfe
1 Replies

3. Shell Programming and Scripting

AWK- extracting values from columns, saving them and gettins statistics

Hello, I am obviously quite new to unix and awk. I need to parse certain columns of a file (delimited by spaces), and somehow save the value of this column somewhere, together with the value of the column just after it (by pairs; so something like ). I'm then supposed to count the times that... (9 Replies)
Discussion started by: acsg
9 Replies

4. Shell Programming and Scripting

Extracting columns from multiple files with awk

hi everyone! I'd like to extract a single column from 5 different files and put them together in an output file. I saw a similar question for 2 input files, and the line of code workd very well, the code is: awk 'NR==FNR{a=$2; next} {print a, $2}' file1 file2 I added the file3, file4 and... (10 Replies)
Discussion started by: orcaja
10 Replies

5. UNIX for Dummies Questions & Answers

Extracting columns from multiple files with awk

hi everyone! I already posted it in scripts, I'm sorry, it's doubled I'd like to extract a single column from 5 different files and put them together in an output file. I saw a similar question for 2 input files, and the line of code workd very well, the code is: awk 'NR==FNR{a=$2; next}... (1 Reply)
Discussion started by: orcaja
1 Replies

6. Shell Programming and Scripting

awk : extracting unique lines based on columns

Hi, snp.txt CHR_A SNP_A BP_A_st BP_A_End CHR_B BP_B SNP_B R2 p-SNP_A p-SNP_B 5 rs1988728 74904317 74904318 5 74960646 rs1427924 0.377333 0.000740085 0.013930081 5 ... (12 Replies)
Discussion started by: genehunter
12 Replies

7. Shell Programming and Scripting

Extracting only a few columns!!!?

Hi All, I have a text file which looks like below. ################################################ Name:xxxxxxx Version:1.0 Class: 2 City : Bangalore Component Part Action Nb New Part Naming Part Name 12345 default 12345.12345 Bad 23456 ... (6 Replies)
Discussion started by: smarty86
6 Replies

8. Shell Programming and Scripting

Extracting columns

The output of the below command is : # yum -e0 -d0 check-update dnsmasq.i386 2.45-1.1.el5_3 updates ecryptfs-utils.i386 75-5.el5 updates fetchmail.i386 6.3.6-1.1.el5_3.1 updates... (16 Replies)
Discussion started by: proactiveaditya
16 Replies

9. Shell Programming and Scripting

extracting multiple consecutive columns using awk

Hello, I have a matrix 200*10,000 and I need to extract the columns between 40 and 77. I dont want to write in awk all the columns. eg: awk '{print $40, $41, $42,$43 ... $77}'. I think should exist a better way to do this. (10 Replies)
Discussion started by: auratus42
10 Replies

10. Shell Programming and Scripting

Need help in extracting columns

Hi , I have a file having around 8 columns spereated by space . Now that I need to extract columns from this. The problem is this functionality is needed in a script and the required columns are dynamic and can range from 2 columns to 8 columns at a time . What I tried without luck is ... (6 Replies)
Discussion started by: praveenbvarrier
6 Replies
Login or Register to Ask a Question
WIPEFS(8)                                                      System Administration                                                     WIPEFS(8)

wipefs - wipe a signature from a device SYNOPSIS
wipefs [options] device... wipefs [--backup] -o offset device... wipefs [--backup] -a device... DESCRIPTION
wipefs can erase filesystem, raid or partition-table signatures (magic strings) from the specified device to make the signatures invisible for libblkid. wipefs does not erase the filesystem itself nor any other data from the device. When used without any options, wipefs lists all visible filesystems and the offsets of their basic signatures. The default output is sub- ject to change. So whenever possible, you should avoid using default outputs in your scripts. Always explicitly define expected columns by using --output columns-list in environments where a stable output is required. wipefs calls the BLKRRPART ioctl when it has erased a partition-table signature to inform the kernel about the change. Note that some filesystems and some partition tables store more magic strings on the device (e.g. FAT, ZFS, GPT). The wipefs command (since v2.31) lists all the offset where a magic strings have been detected. When option -a is used, all magic strings that are visible for libblkid are erased. In this case the wipefs scans the device again after each modification (erase) until no magic string is found. Note that by default wipefs does not erase nested partition tables on non-whole disk devices. For this the option --force is required. OPTIONS
-a, --all Erase all available signatures. The set of erased signatures can be restricted with the -t option. -b, --backup Create a signature backup to the file $HOME/wipefs-<devname>-<offset>.bak. For more details see the EXAMPLES section. -f, --force Force erasure, even if the filesystem is mounted. This is required in order to erase a partition-table signature on a block device. -h, --help Display help text and exit. -J, --json Use JSON output format. -n, --noheadings Do not print a header line. -O, --output list Specify which output columns to print. Use --help to get a list of all supported columns. -n, --no-act Causes everything to be done except for the write() call. -o, --offset offset Specify the location (in bytes) of the signature which should be erased from the device. The offset number may include a "0x" pre- fix; then the number will be interpreted as a hex value. It is possible to specify multiple -o options. The offset argument may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g. "K" has the same meaning as "KiB"), or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB. -p, --parsable Print out in parsable instead of printable format. Encode all potentially unsafe characters of a string to the corresponding hex value prefixed by 'x'. -q, --quiet Suppress any messages after a successful signature wipe. -t, --types list Limit the set of printed or erased signatures. More than one type may be specified in a comma-separated list. The list or individ- ual types can be prefixed with 'no' to specify the types on which no action should be taken. For more details see mount(8). -V, --version Display version information and exit. EXAMPLES
wipefs /dev/sda* Prints information about sda and all partitions on sda. wipefs --all --backup /dev/sdb Erases all signatures from the device /dev/sdb and creates a signature backup file ~/wipefs-sdb-<offset>.bak for each signature. dd if=~/wipefs-sdb-0x00000438.bak of=/dev/sdb seek=$((0x00000438)) bs=1 conv=notrunc Restores an ext2 signature from the backup file ~/wipefs-sdb-0x00000438.bak. AUTHOR
Karel Zak <kzak@redhat.com> ENVIRONMENT
LIBBLKID_DEBUG=all enables libblkid debug output. SEE ALSO
blkid(8), findfs(8) AVAILABILITY
The wipefs command is part of the util-linux package and is available from https://www.kernel.org/pub/linux/utils/util-linux/. util-linux December 2014 WIPEFS(8)