09-30-2010
Quote:
Originally Posted by
malikshahid85
we use 1 or any other digit to print only one blank space between the fields if the fields have more than one space.
So it sounds like a "trim" type function. Strangely, though, when I tried it on my system, removal of the "1" suppressed all output.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have rows of data with variable number of columns.
Is there an easy way to print out the last 4 columns
or rather the 4th and 3rd last column?
data looks like this:
24 20:51 N 9 10.00 Overcast OVC110 27 11 30.04 1017.7
24 19:51 N 7 10.00 Mostly Cloudy BKN110 28 15... (19 Replies)
Discussion started by: Da_Duck
19 Replies
2. UNIX for Dummies Questions & Answers
Dear Gurus,
I have a unix file 2 columns (# delimited) with the following data:
ZTXX_CTBR1-ZBRAN1#ZTXX_CTBR1-ZBRAN_DESC#
01#CASH & CARRY#
02#DRUGSTORE - RX#
04#SUPERMARKET#
05#HYPERMARKET#
17#DRUGSTORE - NO RX#
I would like to have a code that will do 2 things:
1. Delete the header... (16 Replies)
Discussion started by: chumsky
16 Replies
3. Shell Programming and Scripting
Hi,
I need helping in finding some of the text in one file and some columns which have same column in file 1
EG
cat file_1
aaaa
bbbb
cccc
dddd
eeee
fffff
gggg
hhhh
cat file_2
aaaa,abcd,effgh,ereref,name,age,sex,...........
bbbb,efdfh,erere,afdafds,name,age,sex.............. (1 Reply)
Discussion started by: jpkumar10
1 Replies
4. UNIX for Dummies Questions & Answers
Hi Team,
I have a requirement to print the column or find the column number of a particular string in delimited (;) file.
Ex:
aaa;bbb;ccc;rrr;mmm;
gggg;rrr;mmmm;ssss;eee;aaa;
ccc;gggg;tttt;bbbb;dddd;ggggg;rrr;
my file contains 1000+ rows like above example with semicolon... (3 Replies)
Discussion started by: baskivs
3 Replies
5. UNIX for Advanced & Expert Users
Hi All,
I have a fixedwidth file of length 3000. Now i want to copy a column of 4 chars i.e( length 1678-1681) to column 1127 – 1171 to the same file.
Please let me know how can i achive using a single command in fixed width file.
Also source column length is 4 chars and target column length... (4 Replies)
Discussion started by: kiranparsha
4 Replies
6. Shell Programming and Scripting
Hello everyone,
I searched the forum looking for answers to this but I could not pinpoint exactly what I need as I keep having trouble.
I have many files each having two columns and hundreds of rows.
first column is a string (can have many words) and the second column is a number.The files are... (5 Replies)
Discussion started by: isildur1234
5 Replies
7. Shell Programming and Scripting
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies
8. UNIX for Dummies Questions & Answers
I have the code for the below things..
File1 has the content as below
8859 0 subscriberCreate
18 0 subscriberPaymentMethodChange
1650 0 subscriberProfileUpdate
7668 0 subscriberStatusChange
13 4020100 subscriberProfileUpdate
1 4020129 subscriberStatusChange
2 4020307 subscriberCreate
8831... (5 Replies)
Discussion started by: Mahen
5 Replies
9. UNIX for Beginners Questions & Answers
I have a file abc.csv, from which I need column 24(PurchaseOrder_TotalCost) to get the sum_of_amounts with date and row count into another file say output.csv
abc.csv-
UTF-8,,,,,,,,,,,,,,,,,,,,,,,,,
... (6 Replies)
Discussion started by: Tahir_M
6 Replies
10. UNIX for Beginners Questions & Answers
I have data of an excel files as given below,
file1
org1_1 1 1 2.5 100
org1_2 1 2 5.5 98
org1_3 1 3 7.2 88
file2
org2_1 1 1 2.5 100
org2_2 1 2 5.5 56
org2_3 1 3 7.2 70
I have multiple excel files as above shown.
I have to copy column 1, column 4 and paste into a new excel file as... (26 Replies)
Discussion started by: dineshkumarsrk
26 Replies
LEARN ABOUT DEBIAN
jifty::upgrade
Jifty::Upgrade(3pm) User Contributed Perl Documentation Jifty::Upgrade(3pm)
NAME
Jifty::Upgrade - Superclass for schema/data upgrades to Jifty applications
SYNOPSIS
package MyApp::Upgrade;
use base qw/ Jifty::Upgrade /;
use Jifty::Upgrade qw/ since rename /;
since '0.7.4' => sub {
# Rename a column
rename table => 'cthulus', name => 'description',
to => 'mind_numbingly_horrible_word_picture';
};
since '0.6.1' => sub {
my @sizes = ('Huge', 'Gigantic', 'Monstrous', 'Really Big');
my @appearances = ('Horrible', 'Disgusting', 'Frightening', 'Evil');
# populate new columns with some random stuff
my $cthulus = MyApp::Model::CthuluCollection->new;
while (my $cthulu = $cthulus->next) {
$cthulu->set_size($sizes[ int(rand(@sizes)) ]);
$cthulu->set_appearance($appearances[ int(rand(@appearances)) ]);
}
};
DESCRIPTION
"Jifty::Upgrade" is an abstract base class to use to customize schema and data upgrades that happen.
since VERSION SUB
"since" is meant to be called by subclasses of "Jifty::Upgrade". Calling it signifies that SUB should be run when upgrading to version
VERSION, after tables and columns are added, but before tables and columns are removed. If multiple subroutines are given for the same
version, they are run in order that they were set up.
versions
Returns the list of versions that have been registered; this is called by the Jifty::Script::Schema tool to determine what to do while
upgrading.
upgrade_to VERSION
Runs the subroutine that has been registered for the given version; if no subroutine was registered, returns a no-op subroutine.
rename table => CLASS, [column => COLUMN,] to => NAME
Used in upgrade subroutines, this executes the necessary SQL to rename the table, or column in the table, to a new name.
SEE ALSO
Jifty::Manual::Upgrading
perl v5.14.2 2010-12-08 Jifty::Upgrade(3pm)