Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: grossgermany
12,476
Posted By grossgermany
loop in array in python
Hi suppose in python I have a list(or array, or tuple, not sure the difference)
How do I loop inside the size of array.
The pseudo code is:

a=["d","e","f"]
for i = 1 to dim(a)
print a
end...
22,509
Posted By grossgermany
Thanks, may I ask what is the /bin/sh...
Thanks,
may I ask what is the /bin/sh procedure for doing a loop on the output of ls:

imaginary code:
for filehandle in (ls salesreport*.txt):
do
ex filehandle <<'EOF'
1,$s/1975/1945/ig...
22,509
Posted By grossgermany
How to run VI in batch mode
Hi how do I use vi to do change some strings in a shell script loop

1. Run ls first, for each file that contains the word salesreport*.txt, do the following
2. use vi to run the following ex...
Forum: Solaris 10-30-2009
2,558
Posted By grossgermany
fedora core 3
fedora core 3
Forum: Solaris 10-29-2009
2,558
Posted By grossgermany
2 questions for newbies
Hi I'm totally new to solaris 5.9

Two questions.
1. What is the replacement for /proc/cpuinfo (isn't this part of POSIX). I heard it's psrinfo but it doesn't work.
2. I use ssh - v -X with X...
1,850
Posted By grossgermany
How to merge two files with a slight twist
Hi, a brief introduction on the soundex python module(english sound comparison):

import soundex.py
a = "neu yorkk"
b = "new york city"
print soundex.sound_similar(a, b)


output:

1


...
4,079
Posted By grossgermany
use awk to replace empty fields with the latest nonempty field
Hi suppose I have a csv file like this

count,1977,1978,1979
usa, , , blue
japan, red, yellow,green
india, , yellow,blue
china, blue, yellow, green


I want the...
1,966
Posted By grossgermany
How to get the mouse wheel to work without root privilege
Hi,

I use a nomachine terminal to access KDE desktop(redhat linux enterprise) on a server. Is there any way to get the mouse wheel to work without root privilege ?

I have a usb mouse...
2,061
Posted By grossgermany
wow dan, that's amazing, would you mind explain a...
wow dan, that's amazing, would you mind explain a bit on how this works?
what is the ? symbol do?
what is the ($2~/-/) do?
what is the }1 in the end do?
2,061
Posted By grossgermany
How to convert a column to last five digits
Hi

Suppose I have a input.csv file like this

Fort, 2034440-3333
Honda, b293489289
Toyota, 23423000


How to convert the second column to the following format, there are only two cases:...
1,956
Posted By grossgermany
What is the regular expression for REVERSE of five consecutive nubmers
Hi , we all know that the regex for five consecutive number is [0-9][0-9][0-9][0-9][0-9]

But what is the regex for "anything but five consecutive numbers"

I want to use an awk script to replace...
31,388
Posted By grossgermany
Hi Dan, Thanks a lot for your reply. But...
Hi Dan,

Thanks a lot for your reply. But the code won't work in instances such as this:
input: usa,66 canada99292,japan222,44 france59664,egypt223
because within each column, the field...
31,388
Posted By grossgermany
Use to awk to match pattern, and print the pattern
Hi,


I know how to use awk to search some expressions like five consecutive numbers, [0-9][0-9][0-9][0-9][0-9], this is easy.
However, how do I make awk print the pattern that is been...
2,710
Posted By grossgermany
Use awk to pick out zip code
Hi,

Suppose I have a csv file, each line look like this:
ABC Company, 1999, March, caucasian owned, 123 BroadWay NY 92939-2222

How do I create two new columns at the end, one for state, one...
8,537
Posted By grossgermany
Awk symbol for last column
Hi ,

I have a bunch of files with different # of columns but I want to write a single awk script.

What is the awk symbol for last column? say '{print $lastcol}' or something
4,154
Posted By grossgermany
thanks a lot, unfortunately, perl is not...
thanks a lot, unfortunately, perl is not installed on site, nor do i have permission to.
is it possible to do it in python or awk?
4,154
Posted By grossgermany
Merge two rows using awk or python
Hi,
Suppose I have a space delimited file like this:

Serial# 1970 1971 1972 1973 1974
193532 21 2 X X X
200201 20 30 X X 40...
4,666
Posted By grossgermany
I want to replace all strings that are state...
I want to replace all strings that are state abbreviation with blank.
for example, replace NY 12345 with 12345
By the way, what does {1:-TX} mean?
4,666
Posted By grossgermany
Awk search for a element in the list of strings
Hi, how do I match a particular element in a list and replace it with blank?

awk 'sub/[element in the $list]//' $FILE

list="AL, AK, AZ, AR, CA, CO, CT, DE, FL, GA,
HI, ID, IL, IN, IA, KS, KY,...
3,970
Posted By grossgermany
thanks a lot cfajohnson But do you think...
thanks a lot cfajohnson

But do you think sub( / [A-Z][A-Z].*/,"",left) is prone to unintentionally pick up patterns for example in street names, rather than in zip.

Is there a possible way to...
3,970
Posted By grossgermany
Extract zip code information from address, put into new column
Hi, suppose I have a colon delimeterd file with address field like this

blue:john's hospital new haven CT 92881-2322
yellow:La times copr red road los angeles CA90381 1302
red:las vegas hotel...
4,048
Posted By grossgermany
Thanks a lot for the reply, but is it possible to...
Thanks a lot for the reply, but is it possible to create manual translation tables:

Suppose the file is now
A.csv
Toyota Camry,1998,blue
Honda Civic,1999,blue
Acura Inf,2000,yellow

B.csv...
4,048
Posted By grossgermany
I don't know perl, would you please do it in...
I don't know perl, would you please do it in Python or SAS
4,048
Posted By grossgermany
use python or awk to match names 'with error tolerance'
I think this is a very challenging problem I am facing and I have no idea how to deal with it
Suppose I have two csv files

A.csv
Toyota Camry,1998,blue
Honda Civic,1999,blue

B.csv
Toyota...
6,011
Posted By grossgermany
count number of nonempty columns in row
Hi,
Suppose i have a inputfile in csv format.
How to use awk to count 'the number of nonempty columns in each row' minus one, and add the value as a new column in the end

For cosmetic reason,...
Showing results 1 to 25 of 37

 

Featured Tech Videos

All times are GMT -4. The time now is 09:57 AM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy