No 1 answering my question... any reason ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting No 1 answering my question... any reason ?
# 1  
Old 10-29-2011
No 1 answering my question... any reason ?

can some one please help me at my post ?

for hours yet being ignored

Need help on this:

Code:
  nonsense. can't even solve forum ask people redo whole code. LMAO - after asking 101 qns

the pre result should be like this:
Code:
A     A A A A
A A A A   A A
A   A   A A A
A A   A A A A
A     A A A A
A A A A   A A
A A A     A A

result
Code:
A B A A A A B
A A A A B A A
A B A B A A A
A A B A A A A
A B A B A A A
A A A A B A A
A A A B B A A

where B should be filled into those gaps.
can't seems to allocate any Bs if there are more than 10 gaps any reason where went wrong ?

thanks

---------- Post updated 10-30-11 at 12:20 AM ---------- Previous update was 10-29-11 at 02:44 PM ----------

assistance required, thanks

Last edited by nanochan1; 11-03-2011 at 02:59 PM..
# 2  
Old 10-29-2011
nanochan1,
these forums are not your paid-for support organization or 1-800-HELPME.
We do the best we can to providing assistance to the folks, but we're a bunch of volunteers with no contractual obligations.

Please be patient and someone will assist you.

To the point... rather than providing your code (which is good) I'd try verbalize what you're after and provide a more representative data samples: before and after. Looking at your samples I don't see the transformation logic.
# 3  
Old 10-29-2011
how about this:
Code:
tr ' ' '#' < myFile  | sed 's/##/ B/g;s/#/ /g'

where myFile looks like this with 'gaps':
Code:
A     A A A A
A A A A   A A
A   A   A A A
A A   A A A A
A     A A A A
A A A A   A A
A A A     A A


Last edited by vgersh99; 10-29-2011 at 05:57 PM..
# 4  
Old 10-30-2011
Quote:
Originally Posted by nanochan1
can some one please help me at my post ?

for hours yet being ignored

Need help on this:
Please provide the input and the expected output and some explanation.

We are all very happy to help everyone who comes here. But like the mod said, it is a voluntary service. And more over its a weekend! Smilie

--ahamed
# 5  
Old 10-30-2011
sorry and thanks.

i don't quite understand the assistance vgersh99 provided me.

the code given what is it for ?

---------- Post updated at 08:01 PM ---------- Previous update was at 07:59 PM ----------

Quote:
Originally Posted by ahamed101
Please provide the input and the expected output and some explanation.

We are all very happy to help everyone who comes here. But like the mod said, it is a voluntary service. And more over its a weekend! Smilie

--ahamed
lets say i read in a file...

it shows the available spaces remaining from a file

eg.

Quote:
AAAAAAAAAA
AAAAA A AA

2/20 spaces remaining
if the remaining spaces are less or equal to 9 the compiler will run & allocate without any issues (as above), but if i set remaining spaces to be more than 10 spaces out of the 20 spaces

eg.
Quote:
A AA A
A A A A A

11/20 spaces remaining
my compiler will simply hang and not do anything.

what i need to do is... eg i tell the compiler i need 4 spaces to be allocated to the remaining gaps - automatically.
the compliler will then start checking through and slot whichever gaps it could find with B and my result should return like this for instance:

Quote:
ABAABABB
A A A A A
and if i need 8 spaces to be filled it will be

Quote:
ABAABABBBB
ABABA A A
and if 13 spaces needed to be filled

Quote:
ABAABABBBB
ABABABABAB
the codes which i tried to do as show on post #1 only could work for spaces not more than 9 remaining.

eg.
Quote:
AA A AA A
A A A A A

this runs fine
Quote:
A A AA A A
A A

this doesn't - as there are more than 10 spaces remaining

Last edited by nanochan1; 10-30-2011 at 09:13 AM..
# 6  
Old 10-30-2011
I am trying to figure out your logic... Meantime can you post your entire code, inputs to the script and the input file?...

--ahamed

PS: Thank you for using code tags!
# 7  
Old 10-30-2011
Quote:
Originally Posted by nanochan1
Code:
A A AA A A
A A

this doesn't - as there are more than 10 spaces remaining
Code:
awk 'NR==FNR{x=length($0)>x?length($0):x;next}{gsub(FS,OFS);while(length($0)<x)$0=$0OFS}1' OFS=B file file

Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Mgetty Not Answering when Calling from Outside

Hello All, mgetty Version: 1.1.36 OS: OpenSuSE 13.1 (armv7l) Modem: Zoom 56K USB Modem Model 3095 So I've been playing with mgetty for weeks now testing dialing into the USB modem from another PC using the same modem and connecting using minicom (*minicom ---dials to---> mgetty). I had... (3 Replies)
Discussion started by: mrm5102
3 Replies

2. Shell Programming and Scripting

Perl Debug Stepping Answering Questions

I am new to perl and want to get a little better understanding of debugging code in perl. I have a perl script that has questions to be answered like: he following PERL modules are recommended: Crypt::DES Crypt::PasswdMD5 IO::Pty Net::Write::Layer2 String::CRC32 Attempt to install... (0 Replies)
Discussion started by: metallica1973
0 Replies

3. Shell Programming and Scripting

ssh -t answering automatically to the password

hi, i'm using the folowing ssh command to list the newuser "crontab' from myuser ssh -t myuser@host1 "sudo -u newuser crontab -l" this is ok but it is asking me a password. Mot de passe de myuser: The problem is that i want to answer it automatically in a shell script with the... (22 Replies)
Discussion started by: Nicol
22 Replies

4. UNIX for Dummies Questions & Answers

help - question needs answering????

hey, have been set this question at school and cannot think for the life of me how to do this. Ive thought about setuid/setgid and things like that but cant make any snese of it. Can anyone help? question reads: You have a file which has the names, email addresses, mobile numbers and sales... (1 Reply)
Discussion started by: biffa
1 Replies

5. Shell Programming and Scripting

Perl: answering automatically to install questions

Hi everybody, I have been looking for an answer to this issue both on google and on the forum, but I couldn't find anything. please help me :eek: As part of an automated (in perl) install of Solaris 9, I would like to be able to answer automaticaly to the question the installer asks.... (2 Replies)
Discussion started by: zaap
2 Replies

6. BSD

Answering posts

Hi Guys...(if anyone is out there), do these specialist posts ever get answered and do we just have to bide our time and be patient, or whats the deal (3 Replies)
Discussion started by: Gerry405
3 Replies

7. Programming

what is the exact reason ?

please refer the following 2 statements... 1) int i=1,j; j= i++ + i++; 2) int i=1,j; j=++i + ++i; how j becomes 2 and 6 for the above 2 statements respectively ??? ( i guessed j must be 3 and 5) Somebody define the exact reason please.. :( ... (2 Replies)
Discussion started by: shamal
2 Replies
Login or Register to Ask a Question