Sponsored Content
Top Forums Shell Programming and Scripting How to convert a single column into several columns? Post 302528125 by pinpe on Monday 6th of June 2011 12:34:33 PM
Old 06-06-2011
Hi getmmg,

YES! now its working. But please can you try one more time the input file below. This is my "actual" file. Hope you can spare more time on trying to run this again to give 3 columns in order. Thank you so much mate!!

input file:
Code:
382
527
10625
87868
18
5
1807367
8614
730
7025
375
837
3558
15530
5363
7807
368
681
12372
18789
13
254508
366
491
697
20194
18
5
1341408
4419
666
5618
362
837
2645
1272
5046
7690
332
139
11201
18717
13
9760
0
0
10
10
0
0
42629
96
1
247
0
0
3
8
58
0
0
3
24
23
0
0


output file:
Code:
382         366         0    
527         491         0    
10625       697         10   
87868       20194       10   
18          18          0    
5           5           0    
1807367     1341408     42629
8614        4419        96   
730         666         1    
7025        5618        247  
375         362         0    
837         837         0    
3558        2645        3    
15530       1272        8    
5363        5046        58   
7807        7690        0    
368         332         0    
681         139         3    
12372       11201       24   
18789       18717       23   
13          13          0    
254508      9760        0


Br,
Pete
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

single column to multiple columns

Hello, I have a single column of data that I would like to cut/print (with awk or ...) into multiple columns at every empty row (or common character). Input: 5.99123 5.94693 7.21383 5.95202 0.907935 5.99149 6.08427 0.975774 6.077 Output: 5.99123 5.95202 6.08427 5.94693... (7 Replies)
Discussion started by: agibbs
7 Replies

2. Shell Programming and Scripting

Single column to multiple columns in awk

Hi - I'm new to the awk programming language. I'm trying to print a single column of data to several columns, and I found an article on iTWorld.com (ITworld.com - Printing in columns). It looks like the mkCols2 script is very close to what I need to do, but it looks like the end of the code... (2 Replies)
Discussion started by: astroDave
2 Replies

3. UNIX for Dummies Questions & Answers

How to convert a single column into several rows and columns?

I have a program which gives me the output as a single column with hundreds of rows like: 213 314 324 324 123 I want to be able to create a new file from this file which allows me to set the number of rows and columns in the new file, i.e. for this example, if I specify 3 rows and 2... (5 Replies)
Discussion started by: ashton_smith
5 Replies

4. Shell Programming and Scripting

Convert two column data into 8 columns

Apologies if this has been covered - I did search but couldn't find what I was looking for. I have a simple X-Y input file. I want to convert it from two columns into 8 columns - 4 pairs of X-Y data. So my input file looks like X1 Y1 X2 Y2 X3 Y3 X4 Y4 X5 Y5 etc And I want it to look... (8 Replies)
Discussion started by: NickC
8 Replies

5. Shell Programming and Scripting

how to introduce a space in a single column without distrubing the other columns

Hello Experts, I am new to this forum, I would like to do the following changes in one of the column of a txt file, which is having around 9 column. For example, column 3 is having letters like this AB11 AB12 C CA CB AC1 AC2 I would like to convert the same column as follows ... (5 Replies)
Discussion started by: Fredrick
5 Replies

6. Shell Programming and Scripting

Convert columns to single row

Hello all I have data like 1 2 3 4 5 I wish my output would be like 1,2,3,4,5 For this i have executed 'BEGIN {FS="\n"; ORS=","} {print $0}' test and got the output as 1,2,3,4,5, I do not want to have , at the end of 5. output should be like (5 Replies)
Discussion started by: vasuarjula
5 Replies

7. Shell Programming and Scripting

convert columns into rows with respect to first column

Hello All, Please help me with this file. My input file (Tab separated) is like: Abc-01 pc1 -0.69 Abc-01 E2cR 0.459666666666667 Abc-01 5ez.2 1.2265625 Xyz-01 pc1 -0.153 Xyz-01 E2cR 1.7358 Xyz-01 5ez.2 2.0254 Ced-02 pc1 -0.5714 Ced-02 ... (7 Replies)
Discussion started by: mira
7 Replies

8. Shell Programming and Scripting

Multiple columns to a single column

I have this input: 10 22 1 100 11 22 10 1 50 14 3 1 100 23 3 1 100 24 15 1 100 10 22 5 3 1 33.333 11 22 1 100 It has an inconsistent number of fields but the last field is determined by 100/(NF-2) using awk. I want to take this multiple columned input file and transform so that... (2 Replies)
Discussion started by: mdlloyd7
2 Replies

9. Shell Programming and Scripting

Convert single column into multiple rows

Convert Single column to multiple rows file a.txt contains data like below Server=abc Run=1 Tables=10 Sessions=16 Time=380 Jobs=5 Server=abc Run=2 Tables=15 Sessions=16 Time=400 Jobs=5 Server=abc Run=3 Tables=20 Sessions=16 Time=450 (5 Replies)
Discussion started by: sol_nov
5 Replies

10. Shell Programming and Scripting

Convert row to columns start from nth column

Dear All, We have input like this: 161 57 1378 176 1392 262 1444 441 1548 538 1611 670 1684 241 57 1378 208 1393 269 1447 444 1549 538 1610 677 1700 321 ... (4 Replies)
Discussion started by: attila
4 Replies
iconv_koi8-r(5)                                         Standards, Environments, and Macros                                        iconv_koi8-r(5)

NAME
iconv_koi8-r - code set conversion tables for KOI8-R DESCRIPTION
The following code set conversions are supported: +-------------------------------------------------------------------------+ | Code Set Conversions Supported | +--------------+--------+--------------+--------+-------------------------+ | Code |Symbol |Target Code |Symbol | Target Output | +--------------+--------+--------------+--------+-------------------------+ |KOI8-R |koi8 |ISO 8859-5 |iso5 | ISO 8859-5 Cyrillic | +--------------+--------+--------------+--------+-------------------------+ |KOI8-R |koi8 |PC Cyrillic |alt | Alternative PC Cyrillic | +--------------+--------+--------------+--------+-------------------------+ |KOI8-R |koi8 |MS 1251 |win5 | Windows Cyrillic | +--------------+--------+--------------+--------+-------------------------+ |KOI8-R |koi8 |Mac Cyrillic |mac | Macintosh Cyrillic | +--------------+--------+--------------+--------+-------------------------+ CONVERSIONS
The conversions are performed according to the following tables. All values in the tables are given in octal. KOI8-R to ISO 8859-5 For the conversion of KOI8-R to ISO 8859-5, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | KOI8-R | ISO 8859-5 | KOI8-R | ISO 8859-5 | |24 | 4 |320 |337 | |241 | 362 |321 |357 | |242 | 363 |322 |340 | |243 | 361 |323 |341 | |244 | 364 |324 |342 | |245 | 365 |325 |343 | |246 | 366 |327 |322 | |247 | 367 |330 |354 | |250 | 370 |331 |353 | |251 | 371 |332 |327 | |252 | 372 |333 |350 | |253 | 373 |334 |355 | |254 | 374 |335 |351 | |256 | 376 |336 |347 | |257 | 377 |337 |352 | |260 | 360 |340 |316 | |261 | 242 |341 |260 | |262 | 243 |342 |261 | |263 | 241 |343 |306 | |264 | 244 |344 |264 | |265 | 245 |345 |265 | |266 | 246 |346 |304 | |267 | 247 |347 |263 | |270 | 250 |350 |305 | |271 | 251 |351 |270 | |272 | 252 |352 |271 | |273 | 253 |353 |272 | |274 | 254 |354 |273 | |275 | 255 |355 |274 | |276 | 256 |356 |275 | |277 | 257 |357 |276 | |300 | 356 |360 |277 | |301 | 320 |361 |317 | |302 | 321 |362 |300 | |303 | 346 |363 |301 | |304 | 324 |364 |302 | |305 | 325 |365 |303 | |306 | 344 |366 |266 | |307 | 323 |367 |262 | |310 | 345 |370 |314 | |311 | 330 |371 |313 | |312 | 331 |372 |267 | |313 | 332 |373 |310 | |314 | 333 |374 |315 | |315 | 334 |375 |311 | |316 | 335 |376 |307 | |317 | 336 | | | +---------------+----------------+----------------+---------------+ KOI8-R to PC Cyrillic For the conversion of KOI8-R to PC Cyrillic, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | KOI8-R | PC Cyrillic | KOI8-R | PC Cyrillic | |24 | 4 |333 |350 | |200-242 | 40 |334 |355 | |243 | 361 |335 |351 | |244-254 | 40 |336 |347 | |255 | 260 |337 |352 | |256-262 | 40 |340 |236 | |263 | 360 |341 |200 | |264-274 | 40 |342 |201 | |275 | 260 |343 |226 | |276-277 | 40 |344 |204 | |300 | 356 |345 |205 | |301 | 240 |346 |224 | |302 | 241 |347 |203 | |303 | 346 |350 |225 | |304 | 244 |351 |210 | |305 | 245 |352 |211 | |306 | 344 |353 |212 | |307 | 243 |354 |213 | |310 | 345 |355 |214 | |311 | 250 |356 |215 | |312 | 251 |357 |216 | |313 | 252 |360 |217 | |314 | 253 |361 |237 | |315 | 254 |362 |220 | |316 | 255 |363 |221 | |317 | 256 |364 |222 | |320 | 257 |365 |223 | |321 | 357 |366 |206 | |322 | 340 |367 |202 | |323 | 341 |370 |234 | |324 | 342 |371 |233 | |325 | 343 |372 |207 | |326 | 246 |373 |230 | |327 | 242 |374 |235 | |330 | 354 |375 |231 | |331 | 353 |376 |227 | |332 | 247 | | | +---------------+----------------+----------------+---------------+ KOI8-R to MS 1251 For the conversion of KOI8-R to MS 1251, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | KOI8-R | MS 1251 | KOI8-R | MS 1251 | |24 | 4 |317 |356 | |200-237 | 40 |320 |357 | |241 | 220 |321 |377 | |242 | 203 |322 |360 | |243 | 270 |323 |361 | |244 | 272 |324 |362 | |245 | 276 |325 |363 | |246 | 263 |326 |346 | |247 | 277 |327 |342 | |250 | 274 |330 |374 | |251 | 232 |331 |373 | |252 | 234 |332 |347 | |253 | 236 |333 |370 | |254 | 235 |334 |375 | |255 | 210 |335 |371 | |256 | 242 |336 |367 | |257 | 237 |337 |372 | |260 | 271 |340 |336 | |261 | 200 |341 |300 | |262 | 201 |342 |301 | |263 | 250 |343 |326 | |264 | 252 |344 |304 | |265 | 275 |345 |305 | |266 | 262 |346 |324 | |267 | 257 |347 |303 | |270 | 243 |350 |325 | |271 | 212 |351 |310 | |272 | 214 |352 |311 | |273 | 216 |353 |312 | |274 | 215 |354 |313 | |275 | 210 |355 |314 | |276 | 241 |356 |315 | |277 | 217 |357 |316 | |300 | 376 |360 |317 | |301 | 340 |361 |337 | |302 | 341 |362 |320 | |303 | 366 |363 |321 | |304 | 344 |364 |322 | |305 | 345 |365 |323 | |306 | 364 |366 |306 | |307 | 343 |367 |302 | |310 | 365 |370 |334 | |311 | 350 |371 |333 | |312 | 351 |372 |307 | |313 | 352 |373 |330 | |314 | 353 |374 |335 | |315 | 354 |375 |331 | |316 | 355 |376 |327 | |376 | 227 | | | +---------------+----------------+----------------+---------------+ KOI8-R to Mac Cyrillic For the conversion of KOI8-R to Mac Cyrillic, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | KOI8-R | Mac Cyrillic | KOI8-R | Mac Cyrillic | |24 | 4 |317 |356 | |200-237 | 40 |320 |357 | |240 | 312 |321 |337 | |241 | 254 |322 |360 | |242 | 257 |323 |361 | |243 | 336 |324 |362 | |244 | 271 |325 |363 | |245 | 317 |326 |346 | |246 | 264 |327 |342 | |247 | 273 |330 |374 | |250 | 300 |331 |373 | |251 | 275 |332 |347 | |252 | 277 |333 |370 | |253 | 40 |334 |375 | |254 | 316 |335 |371 | |255 | 40 |336 |367 | |256 | 331 |337 |372 | |257 | 333 |340 |236 | |260 | 334 |341 |200 | |261 | 253 |342 |201 | |262 | 256 |343 |226 | |263 | 335 |344 |204 | |264 | 270 |345 |205 | |265 | 301 |346 |224 | |266 | 247 |347 |203 | |267 | 272 |350 |225 | |270 | 267 |351 |210 | |271 | 274 |352 |211 | |272 | 276 |353 |212 | |273 | 40 |354 |213 | |274 | 315 |355 |214 | |275 | 40 |356 |215 | |276 | 330 |357 |216 | |277 | 332 |360 |217 | |300 | 376 |361 |237 | |301 | 340 |362 |220 | |302 | 341 |363 |221 | |303 | 366 |364 |222 | |304 | 344 |365 |223 | |305 | 345 |366 |206 | |306 | 364 |367 |202 | |307 | 343 |370 |234 | |310 | 365 |371 |233 | |311 | 350 |372 |207 | |312 | 351 |373 |230 | |313 | 352 |374 |235 | |314 | 353 |375 |231 | |315 | 354 |376 |227 | |316 | 355 | | | +---------------+----------------+----------------+---------------+ 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_koi8-r(5)
All times are GMT -4. The time now is 12:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy