04-23-2008
awk - list to tables
Hello there,
I have large tab-delimitated lists (see input file) and I need to convert it into tab-delimitated tables (see output file). I would like to do it with an awk script. Any ideas?
Input file:
header1 <tab> a <tab> a <tab> a <tab> a . . .
header2 <tab> b <tab> b <tab> b <tab> b . . .
header3 <tab> c <tab> c <tab> c <tab> c . . .
header4 <tab> d <tab> d <tab> d <tab> d . . .
. . .
Output file:
header1 <tab> header2 <tab> header3 <tab> header4 . . .
a <tab> b <tab> c <tab> d . . .
a <tab> b <tab> c <tab> d . . .
a <tab> b <tab> c <tab> d . . .
a <tab> b <tab> c <tab> d . . .
. . .
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
how would i go about having a index.php page in a folder, in the folder several files named greece.rar and france.rar and other countrys. could php get a list of these, put the names into a table, listed downwards, and the file-names clickable to open that file.? (2 Replies)
Discussion started by: perleo
2 Replies
2. Shell Programming and Scripting
I am trying to transpose tables listed in the format into format. Any help would be greatly appreciated.
Input:
test_data_1
1 2 90%
4 3 91%
5 4 90%
6 5 90%
9 6 90%
test_data_2
3 5 92%
5 4 92%
7 3 93%
9 2 92%
1 1 92%
...
Output:... (7 Replies)
Discussion started by: justthisguy
7 Replies
3. UNIX for Dummies Questions & Answers
I have a host table that looks similar like this:
# IP Name Comment
10.10.10.1 Lab1-1 # Static for Lab1 subnet
10.10.10.2 Lab1-2 # Static for Lab1 subnet
10.10.10.3 Lab1-3 ... (2 Replies)
Discussion started by: mjl927
2 Replies
4. Shell Programming and Scripting
I am working on awk script to generate an HTML format output. With input file as below I am able to generate a HTML file however I want to saperate spare devices in a different table than rest of the devices and which has only Bunch ID, RAW Size and "Bunch Spare" status columns.
INPUT File :
... (2 Replies)
Discussion started by: dynamax
2 Replies
5. Shell Programming and Scripting
I'm new to linux and unix
I would like to know how to display tables of 6 line after line
Output should be
1*6 = 6
2*6 = 12
3*6 = 18
4*6 = 24
etc
I can display line by line but not continuously
Any suggestion (3 Replies)
Discussion started by: electricair
3 Replies
6. Shell Programming and Scripting
Hi,
Can anyone help me that, How to see the table fields in Oracle database through shell script(ksh).
I have tried with the following:
sqlplus -s $user/$passwd@$sid << SQL >> session.log
select * from Testtab.sql
I'm not able to see anything..
Thanks (4 Replies)
Discussion started by: zxcjggu708
4 Replies
7. Shell Programming and Scripting
Hi everyone,
This is an exemple of inpout.txt file (a "," delimited text file which can be open as csv file):
ID, Code, Value, Store SP|01, AABBCDE, 15, 3 SP|01, AABBCDE, 14, 2 SP|01, AABBCDF, 13, 2 SP|01, AABBCDE, 16, 3 SP|02, AABBCED, 15, 2 SP|01, AABBCDF, 12, 3 SP|01, AABBCDD,... (1 Reply)
Discussion started by: jeremy589
1 Replies
8. Shell Programming and Scripting
I have 3 file inputs,
file1
20160302|5485368299953|96|510101223440252|USA|5485368299953|6|800|2300|0
20160530|5481379883742|7|510101242850814|USA|5481379883742|5|540|2181|1500
20160513|5481279653404|24|510100412142433|INDIA|5481279653404|3|380|1900|0... (1 Reply)
Discussion started by: radius
1 Replies
LEARN ABOUT OPENSOLARIS
igawk
IGAWK(1) Utility Commands IGAWK(1)
NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO
gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWgawk |
+--------------------+-----------------+
|Interface Stability | Volatile |
+--------------------+-----------------+
NOTES
Source for gawk is available on http://opensolaris.org.
Free Software Foundation Nov 3 1999 IGAWK(1)