Sponsored Content
Top Forums UNIX for Advanced & Expert Users Script to make a table from Named Variables. Post 302526978 by shariramani on Thursday 2nd of June 2011 04:06:54 AM
Old 06-02-2011
Here I am giving more data to test

Input File:
Code:
a=1,c=3,d=4,e=5,f=6,g=7,h=8
a=11,b=12,d=14,e=15,f=16,g=17,h=18
a=21,b=22,c=23,e=25,f=26,g=27,h=28
a=31,b=32,c=33,d=34,f=36,g=37,h=38
a=41,b=42,c=43,d=44,e=45,g=47,h=48
a=51,b=52,c=53,d=54,e=55,f=56,h=58
a=61,b=62,c=63,d=64,e=65,f=66,g=67,
a=71,b=72,c=73,d=74,e=75,f=76,g=77,h=78
a=81,b=82,c=83,d=84,e=85,f=86,g=87,h=88
a=91,b=92,c=93,d=94,e=95,f=96,g=97,h=98
a=101,b=102,c=103,d=104,e=105,f=106,g=107,h=108
a=111,c=113,d=114,e=115,f=116,g=117,h=118
a=121,b=122,c=123,e=125,f=126,g=127,h=128
a=131,b=132,c=133,d=134,e=135,f=136,g=137,h=138
a=141,b=142,c=143,d=144,e=145,f=146,g=147,h=148
a=151,b=152,c=153,d=154,e=155,g=157,h=158
a=161,b=162,c=163,d=164,e=165,f=166,g=167,h=168
a=171,b=172,c=173,d=174,f=176,g=177,h=178
a=181,b=182,d=184,f=186,g=187,h=188

Output file required (see there are double comma at place of missing field in rows)
Code:
a,b,c,d,e,f,g,h
1,,3,4,5,6,7,8
11,12,,14,15,16,17,18
21,22,23,,25,26,27,28
31,32,33,34,,36,37,38
41,42,43,44,45,,47,48
51,52,53,54,55,56,,58
61,62,63,64,65,66,67,
71,72,73,74,75,76,77,78
81,82,83,84,85,86,87,88
91,92,93,94,95,96,97,98
101,102,103,104,105,106,107,108
111,,113,114,115,116,117,118
121,122,123,,125,126,127,128
131,132,133,134,135,136,137,138
141,142,143,144,145,146,147,148
151,152,153,154,155,,157,158
161,162,163,164,165,166,167,168
171,172,173,174,,176,177,178
181,182,,184,,186,187,188


Last edited by Scott; 06-02-2011 at 08:15 AM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Read variables from Access table

Hi! I've just started learning shell scripting, and have been somewhat 'thrown in at the deep-end and told to swim' so excuse my complete lack of knowledge and ignorance, but here goes... I've been given a unix script to 'tidy up'. Basically the script consists of the few lines of code being... (2 Replies)
Discussion started by: Sn33R
2 Replies

2. Shell Programming and Scripting

How to make variables in script function local?

Is it possible to make function variables local? I mean for example, I have a script variable 'name' and in function I have declared variable 'name' I need to have script's 'name' have the same value as it was before calling the function with the same declaration. The way to preserve a... (5 Replies)
Discussion started by: alex_5161
5 Replies

3. UNIX for Dummies Questions & Answers

MAKE and its macros and variables

I want to build a Makefile that simply takes a template file and modifies it (sed or perl, probably) before installing the result in the right place - my problem is creating the variable for substitution... So I have SYSTEM = SYS1 SYS2 SYS1_CHANNELS = CHANNEL1 CHANNEL2 CHANNEL4... (1 Reply)
Discussion started by: JerryHone
1 Replies

4. UNIX for Dummies Questions & Answers

Trying to make fixtures table with lynx --dump and pipe filters

Hey, I'm trying to make a nice clear table of fixtures. lynx --dump Fixtures & Reports | Fixtures | Arsenal.com | tail -n+360 | less #tail to remove 1st 360 line I'm trying to remove the 'Add to Calendar' bit next I tried pipping through sed but not sure if I did it right sed 's/\Add... (3 Replies)
Discussion started by: 64mb
3 Replies

5. Shell Programming and Scripting

Converting html table data into multiple variables.

Hi, Basically what I am trying to do is the following. I have created a shell script to grab timetabling information from a website using curl then I crop out only the data I need which is a table based on the current date. It leaves me with a file that has the table I want plus a small amount... (2 Replies)
Discussion started by: domsmith
2 Replies

6. Solaris

how do i make a route entry permanent in the routing table on solaris 8?

how do I make sure that the entry in the routing table on Solaris 8 stay permanent after rebooting the server. For example route add 172.20.1.60 -netmask 255.255.255.0 172.20.255.253 Each time the server reboots the entry disappears when using the command netstat -nr (2 Replies)
Discussion started by: tv.praveenkumar
2 Replies

7. UNIX for Advanced & Expert Users

How to make the variables of one script available for the other scripts?

Hello Everyone, I want to know how can we make the variables of one script available for the other script? for example i have three scripts variable_availability.sh,first.sh,second.sh and a file containing variables called common ---------------------------------- cat variable_availability.sh... (2 Replies)
Discussion started by: Kesavan
2 Replies

8. Shell Programming and Scripting

Find and replace variables using a csv table

I have a flat file (template) where I want to replace variables based upon a value in another file (csv). The variables in the template are named %VAR_X_z% The values are in the csv file and X is field 0 of each line and y field 1 and up. Example of the csv: Badidas, 13.00, 12.00, 11.00,... (8 Replies)
Discussion started by: biscayne
8 Replies

9. Shell Programming and Scripting

Make a table from a text file

Hi, I have a pipe separated text file. Can some someone tell me how to convert it to a table? Text File contents. |Activities|Status1|Status2|Status3| ||NA|$io_running2|$io_running3| |Replication Status|NA|$running2|$running3| ||NA|$master2|$master3|... (1 Reply)
Discussion started by: rocky88
1 Replies

10. UNIX for Dummies Questions & Answers

How to make entries background tasks in the table?

Hi am new to unix , when the background task is running how to put entry in the table and also if there is any issue how to stop the running task. can anyone help me... (1 Reply)
Discussion started by: Venkatesh1
1 Replies
ISPRINT(3)						   BSD Library Functions Manual 						ISPRINT(3)

NAME
isprint -- printing character test (space character inclusive) LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <ctype.h> int isprint(int c); DESCRIPTION
The isprint() function tests for any printing character, including space (' '). The value of the argument must be representable as an unsigned char or the value of EOF. In the ASCII character set, this includes the following characters (preceded by their numeric values, in octal): 040 sp 041 ``!'' 042 ``"'' 043 ``#'' 044 ``$'' 045 ``%'' 046 ``&'' 047 ``''' 050 ``('' 051 ``)'' 052 ``*'' 053 ``+'' 054 ``,'' 055 ``-'' 056 ``.'' 057 ``/'' 060 ``0'' 061 ``1'' 062 ``2'' 063 ``3'' 064 ``4'' 065 ``5'' 066 ``6'' 067 ``7'' 070 ``8'' 071 ``9'' 072 ``:'' 073 ``;'' 074 ``<'' 075 ``='' 076 ``>'' 077 ``?'' 100 ``@'' 101 ``A'' 102 ``B'' 103 ``C'' 104 ``D'' 105 ``E'' 106 ``F'' 107 ``G'' 110 ``H'' 111 ``I'' 112 ``J'' 113 ``K'' 114 ``L'' 115 ``M'' 116 ``N'' 117 ``O'' 120 ``P'' 121 ``Q'' 122 ``R'' 123 ``S'' 124 ``T'' 125 ``U'' 126 ``V'' 127 ``W'' 130 ``X'' 131 ``Y'' 132 ``Z'' 133 ``['' 134 ``'' 135 ``]'' 136 ``^'' 137 ``_'' 140 ```'' 141 ``a'' 142 ``b'' 143 ``c'' 144 ``d'' 145 ``e'' 146 ``f'' 147 ``g'' 150 ``h'' 151 ``i'' 152 ``j'' 153 ``k'' 154 ``l'' 155 ``m'' 156 ``n'' 157 ``o'' 160 ``p'' 161 ``q'' 162 ``r'' 163 ``s'' 164 ``t'' 165 ``u'' 166 ``v'' 167 ``w'' 170 ``x'' 171 ``y'' 172 ``z'' 173 ``{'' 174 ``|'' 175 ``}'' 176 ``~'' RETURN VALUES
The isprint() function returns zero if the character tests false and returns non-zero if the character tests true. COMPATIBILITY
The 4.4BSD extension of accepting arguments outside of the range of the unsigned char type in locales with large character sets is considered obsolete and may not be supported in future releases. The iswprint() function should be used instead. SEE ALSO
ctype(3), isalnum_l(3), iswprint(3), ascii(7) STANDARDS
The isprint() function conforms to ISO/IEC 9899:1990 (``ISO C90''). BSD
July 17, 2005 BSD
All times are GMT -4. The time now is 07:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy