I am very new to the shell scripting and I hope someone can help me with this.
I have thousands of files with certain format of information and I need to do this for all my files.
For each file, grab the numbers in the first and second rows and place them in the position 1 and 2 of the rest rows.
The numbers of the first and second rows are different for each file and also each file has different number of rows.
Here's the examples:
I'd like to have something like this:
Your help is much appreciated.
Moderator's Comments:
Please use code tags when posting data and code samples!
Last edited by vgersh99; 11-15-2010 at 06:01 PM..
Reason: code tags, please!
Could anybody help me.
I need to create a script that reads a text file from STDIN and prints out the file to STDOUT with line numbers at the beginning of each line.
Thanks. (5 Replies)
Hi
I am trying to get the value of several results in a file called seq032.diag.
The values I am looking for is down under Smooth Tracking nodes and is for g01r01 g02r01 s01t02 etc etc. The problem is that when I try to use look for text and tail etc, it works fine in one result file. In... (1 Reply)
Hi All,
I have a doubt.
Can we assign a regular expression for pattern searching to a variable in a script and then use that variable in place of a regular expression in sed command.I tried but got some syntax error!!Is it not possible.Because my requirement is that i have a generic script to get... (8 Replies)
hi My requirement is this:
I have a file having around 100000 records pipe delimited. Now I want to compare record 1 with record 2 and similarly record3 with record 4, this goes on.. For this purpose i put a script as follows:
#!bin/ksh
ct_line=1
nxt_line=`expr ${ct_line} + 1`
awk -F "|"... (1 Reply)
How can I specify special meaning characters like ^ or $ inside a regex range. e.g
Suppose I want to search for a string that either starts with '|' character or begins with start-of-line character.
I tried the following but it does not work:
sed 's/\(\)/<do something here>/g' file1
... (3 Replies)
How would you do vim copy line and paste at the beginning, middle, and end of another line. I know yy copies the whole line and p pastes the whole line, but on its own separate line. Sometimes I would like to copy a line to the beginning, middle, or end of another line. I would think this would be... (3 Replies)
I need to comment the lines starting with pattern "exclude" or "exclude=". If the work exclude comes at any other part, ignore it. Also, ignore, excludes, excluded etc. Ie only comment the line starting with exclude.
File contents.
exclude
exclude=
hi I am excluded
excludes
excludes=
... (9 Replies)
Hi
from a script i want to to read a file beginning at line e.g. number 21 to the EOF.
less +n21 temp.txt
Bevor the result, it brings an empty page, so that i cant use for scripting.
Any idea how the problem can be solved?
Thanks in advance!
IMPe (2 Replies)
Hello All,
I have a text file which gets uploaded to tables using shells script. However before running that script I need to alter it, like in the below I have to firstly find the word 1234 and remove the new line from end of it.
1234,5678,fasfasasfsadf
abc
changes to... (11 Replies)
Discussion started by: Sandeep_sandy
11 Replies
LEARN ABOUT SUNOS
iconv_maz
iconv_maz(5) Standards, Environments, and Macros iconv_maz(5)NAME
iconv_maz - code set conversion tables for Mazovia
DESCRIPTION
The following code set conversions are supported:
+--------------------------------------------------------------------+
| Code Set Conversions Supported |
+--------------+--------+--------------+--------+--------------------+
| Code |Symbol |Target Code |Symbol | Target |
+--------------+--------+--------------+--------+--------------------+
|Output | | | | |
+--------------+--------+--------------+--------+--------------------+
|Mazovia |maz |ISO 8859-2 |iso2 | ISO Latin 2 |
+--------------+--------+--------------+--------+--------------------+
|Mazovia |maz |MS 1250 |win2 | Windows Latin 2 |
+--------------+--------+--------------+--------+--------------------+
|Mazovia |maz |MS 852 |dos2 | MS-DOS Latin 2 |
+--------------+--------+--------------+--------+--------------------+
|Mazovia |maz |DHN |dhn | Dom Hanlowy Nauki |
+--------------+--------+--------------+--------+--------------------+
CONVERSIONS
The conversions are performed according to the following tables. All values in the tables are given in octal.
Mazovia to ISO 8859-2
For the conversion of Mazovia to ISO 8859-2, all characters not in the following table are mapped unchanged.
+-----------------------------------------------------------------+
| | Conversions|Performed | |
| Mazovia | ISO 8859-2 | Mazovia | ISO 8859-2 |
|24-177 | 40 |230 |246 |
|200 | 307 |231 |326 |
|201 | 374 |232 |334 |
|202 | 351 |233 |40 |
|203 | 342 |234 |243 |
|204 | 344 |235 |40 |
|205 | 40 |236 |266 |
|206 | 261 |237 |40 |
|207 | 347 |240 |254 |
|210 | 40 |241 |257 |
|211 | 353 |242 |363 |
|212-213 | 40 |243 |323 |
|214 | 356 |244 |361 |
|215 | 346 |245 |321 |
|216 | 304 |246 |274 |
|217 | 241 |247 |277 |
|220 | 312 |250-340 |40 |
|221 | 352 |341 |337 |
|222 | 263 |342-365 |40 |
|223 | 364 |366 |367 |
|224 | 366 |367 |40 |
|225 | 306 |370 |260 |
|226-227 | 40 |371-376 |40 |
|256 | 201 | | |
+---------------+----------------+----------------+---------------+
Mazovia to MS 1250
For the conversion of Mazovia to MS 1250, all characters not in the following table are mapped unchanged.
+---------------+----------------+----------------+---------------+
| Mazovia | MS 1250 | Mazovia | MS 1250 |
|200 | 307 |236 |234 |
|201 | 374 |237 |40 |
|202 | 351 |240 |217 |
|203 | 342 |241 |257 |
|204 | 344 |242 |363 |
|205 | 40 |243 |323 |
|206 | 271 |244 |361 |
|207 | 347 |245 |321 |
|210 | 40 |246 |237 |
|211 | 353 |247 |277 |
|212-213 | 40 |250-251 |40 |
|214 | 356 |252 |254 |
|215 | 346 |253-255 |40 |
|216 | 304 |256 |253 |
|217 | 245 |257 |273 |
|220 | 312 |260-340 |40 |
|221 | 352 |341 |337 |
|222 | 263 |342-345 |40 |
|223 | 364 |346 |265 |
|224 | 366 |347-360 |40 |
|225 | 306 |361 |261 |
|226-227 | 40 |362-365 |0 |
|230 | 214 |366 |367 |
|231 | 326 |367 |40 |
|232 | 334 |370 |260 |
|233 | 40 |371 |40 |
|234 | 243 |372 |267 |
|235 | 40 |373-376 |40 |
|274 | 212 | | |
+---------------+----------------+----------------+---------------+
Mazovia to MS 852
For the conversion of Mazovia to MS 852, all characters not in the following table are mapped unchanged.
+-----------------------------------------------------------------+
| | Conversions|Performed | |
| Mazovia | MS 852 | Mazovia | MS 852 |
|205 | 40 |234 |235 |
|206 | 245 |235 |40 |
|210-213 | 40 |236 |230 |
|215 | 206 |237 |40 |
|217 | 244 |240 |215 |
|220 | 250 |241 |275 |
|221 | 251 |243 |340 |
|222 | 210 |244 |344 |
|225 | 217 |245 |343 |
|226-227 | 40 |246 |253 |
|230 | 227 |247 |276 |
|233 | 40 |250-375 |40 |
|227 | 327 | | |
+---------------+----------------+----------------+---------------+
Mazovia to DHN
For the conversion of Mazovia to DHN, all characters not in the following table are mapped unchanged.
+-----------------------------------------------------------------+
| | Conversions|Performed | |
| Mazovia | DHN | Mazovia | DHN |
|200-205 | 40 |234 |203 |
|206 | 211 |236 |217 |
|207-214 | 40 |240 |207 |
|215 | 212 |241 |210 |
|216 | 40 |242 |216 |
|217 | 200 |243 |205 |
|220 | 202 |244 |215 |
|221 | 214 |246 |220 |
|225 | 201 |247 |221 |
|230 | 206 | | |
+---------------+----------------+----------------+---------------+
FILES
/usr/lib/iconv/*.so conversion modules
/usr/lib/iconv/*.t conversion tables
/usr/lib/iconv/iconv_data list of conversions supported by conversion tables
SEE ALSO iconv(1), iconv(3C), iconv(5)SunOS 5.10 18 Apr 1997 iconv_maz(5)