Sponsored Content
Top Forums Shell Programming and Scripting Changing file with rows and columns into just 1 column Post 302395614 by ac130pilot on Tuesday 16th of February 2010 01:38:45 PM
Old 02-16-2010
Thanks awesome. For the next step, how would I make a loop that would go through each row, saving the integer in that row to a variable, and replacing its counterpart in the original file with 4 rows and different numbers of columns?

Is there a command that reads through a file one word at a time like in MATLAB?

Thanks!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to check Null values in a file column by column if columns are Not NULLs

Hi All, I have a table with 10 columns. Some columns(2nd,4th,5th,7th,8th and 10th) are Not Null columns. I'll get a tab-delimited file and want to check col by col and generate seperate error code for each col eg:102 if 2nd col value is NULL and 104 if 4th col value is NULL so on... I am a... (7 Replies)
Discussion started by: Mandab
7 Replies

2. 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

3. Shell Programming and Scripting

How to changes rows to columns in a file

Hi, I have a small requirement in chainging the rows to columns. The below example.txt contains info as shown Name:Person1 Age:30 Name:Person2 Age:40 Name:Person3 Age:50 I want to make it displayed as hown below Name:Person1 Age:30 Name:person2 Age:40 Name:Person3 Age:50 I... (4 Replies)
Discussion started by: oracle123
4 Replies

4. Shell Programming and Scripting

Changing one column of delimited file column to fixed width column

Hi, Iam new to unix. I have one input file . Input file : ID1~Name1~Place1 ID2~Name2~Place2 ID3~Name3~Place3 I need output such that only first column should change to fixed width column of 15 characters of length. Output File: ID1<<12 spaces>>Name1~Place1 ID2<<12... (5 Replies)
Discussion started by: manneni prakash
5 Replies

5. Shell Programming and Scripting

changing csv file contents to file of rows

i have a file a.txt contents as 1,2,3,4,......etc...in a single line, i want to write to another file in rows as 1 2 3 4 5 can u help? i do not know the length of a.txt (4 Replies)
Discussion started by: pravfraz
4 Replies

6. 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

7. UNIX for Dummies Questions & Answers

merging rows into new file based on rows and first column

I have 2 files, file01= 7 columns, row unknown (but few) file02= 7 columns, row unknown (but many) now I want to create an output with the first field that is shared in both of them and then subtract the results from the rest of the fields and print there e.g. file 01 James|0|50|25|10|50|30... (1 Reply)
Discussion started by: A-V
1 Replies

8. Shell Programming and Scripting

Deleting all the fields(columns) from a .csv file if all rows in that columns are blanks

Hi Friends, I have come across some files where some of the columns don not have data. Key, Data1,Data2,Data3,Data4,Data5 A,5,6,,10,, A,3,4,,3,, B,1,,4,5,, B,2,,3,4,, If we see the above data on Data5 column do not have any row got filled. So remove only that column(Here Data5) and... (4 Replies)
Discussion started by: ks_reddy
4 Replies

9. Shell Programming and Scripting

awk split columns after matching on rows and summing the last column

input: chr1 1 2 3 chr1 1 2 4 chr1 2 4 5 chr2 3 6 9 chr2 3 6 10 Code: awk '{a+=$4}END{for (i in a) print i,a}' input Output: chr112 7 chr236 19 chr124 5 Desired output: chr1 1 2 7 chr2 3 6 19 chr1 2 4 5 (1 Reply)
Discussion started by: jacobs.smith
1 Replies

10. UNIX for Advanced & Expert Users

Conversion of rows to columns using awk based om column value

HI, My Input file data is dn:adcfgeneral id:13343 Name:xxxxxx Password:iutyerwuitywue wpuwt tuiytruityrutyrwtyrwp dn:cdferwjyyyy id:3875 Name:yyyy Password :hgfdsjkfhdsfkdlshf dshfkldshfdklsfh interset:uiuiufj My output should be ... (6 Replies)
Discussion started by: dineshaila
6 Replies
Gtk2::Table(3)						User Contributed Perl Documentation					    Gtk2::Table(3)

NAME
Gtk2::Table HIERARCHY
Glib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gtk2::Widget +----Gtk2::Container +----Gtk2::Table INTERFACES
Glib::Object::_Unregistered::AtkImplementorIface Gtk2::Buildable METHODS
widget = Gtk2::Table->new ($rows, $columns, $homogeneous=FALSE) o $rows (integer) o $columns (integer) o $homogeneous (boolean) $table->attach ($child, $left_attach, $right_attach, $top_attach, $bottom_attach, $xoptions, $yoptions, $xpadding, $ypadding) o $child (Gtk2::Widget) o $left_attach (integer) o $right_attach (integer) o $top_attach (integer) o $bottom_attach (integer) o $xoptions (Gtk2::AttachOptions) o $yoptions (Gtk2::AttachOptions) o $xpadding (integer) o $ypadding (integer) $table->attach_defaults ($widget, $left_attach, $right_attach, $top_attach, $bottom_attach) o $widget (Gtk2::Widget) o $left_attach (integer) o $right_attach (integer) o $top_attach (integer) o $bottom_attach (integer) integer = $table->get_col_spacing ($column) o $column (integer) $table->set_col_spacing ($column, $spacing) o $column (integer) o $spacing (integer) $table->set_col_spacings ($spacing) o $spacing (integer) integer = $table->get_default_col_spacing integer = $table->get_default_row_spacing boolean = $table->get_homogeneous $table->set_homogeneous ($homogeneous) o $homogeneous (boolean) $table->resize ($rows, $columns) o $rows (integer) o $columns (integer) integer = $table->get_row_spacing ($row) o $row (integer) $table->set_row_spacing ($row, $spacing) o $row (integer) o $spacing (integer) $table->set_row_spacings ($spacing) o $spacing (integer) PROPERTIES
'column-spacing' (Glib::UInt : readable / writable / private) The amount of space between two consecutive columns 'homogeneous' (boolean : readable / writable / private) If TRUE, the table cells are all the same width/height 'n-columns' (Glib::UInt : readable / writable / private) The number of columns in the table 'n-rows' (Glib::UInt : readable / writable / private) The number of rows in the table 'row-spacing' (Glib::UInt : readable / writable / private) The amount of space between two consecutive rows ENUMS AND FLAGS
flags Gtk2::AttachOptions o 'expand' / 'GTK_EXPAND' o 'shrink' / 'GTK_SHRINK' o 'fill' / 'GTK_FILL' SEE ALSO
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container COPYRIGHT
Copyright (C) 2003-2008 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.12.1 2010-07-05 Gtk2::Table(3)
All times are GMT -4. The time now is 01:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy