Search Results

Search: Posts Made By: vinzping
Forum: Programming 11-21-2011
1,164
Posted By vinzping
Thanks for your response! Reason why I...
Thanks for your response!

Reason why I don't use awk is because currently I'm learning c++.

anyway I've managed to solve my issues.
Forum: Programming 11-20-2011
1,164
Posted By vinzping
I thought I insert it in here, ...
I thought I insert it in here,

while(getline(ss,line2,','))
{
setPoint2D.insert(p2d,line2);
}


...
Forum: Programming 11-20-2011
1,164
Posted By vinzping
trouble with delimiter
Hi all,

I have a flat file storing data like this,

Testing,[1,2,3]
What I'm trying to do is to retrieve the data "1", "2" and "3".
So far I manage retrieve the data by using the code below,...
Forum: Programming 11-10-2011
6,852
Posted By vinzping
Thanks corona! For the codes below, if I want to...
Thanks corona! For the codes below, if I want to use vector instead of array. How should I do it to achieve the same result?


struct test
{
int a;
int b;
int c;
};

test...
Forum: Programming 11-10-2011
6,852
Posted By vinzping
Array and Vector
Hi all, from my understanding I understand that I can use array in this manner.


struct test
{
int a;
int b;
int c;
};

test testing[10]; //creating an array with the structer...
3,198
Posted By vinzping
From my understanding $5 and $6 are special...
From my understanding $5 and $6 are special variables referring to the arguments passed in SHELL and for $0 is actually referring to the script name.

Hope it helps a bit in your understanding
116,659
Posted By vinzping
Thanks for all your response! But can i...
Thanks for all your response!

But can i check with you guys, is it possible to clear the value in a 2d array with 2 variables as its value? E.g.

${a[$j$i]}
116,659
Posted By vinzping
Thanks jay!
Thanks jay!
116,659
Posted By vinzping
BASH - Clearing value in a variable
anyone has any idae how do i clear the value in a variable in BASH?

So far I come across "Clear-variable", however it can only clear a "Local" and "Global" variable. I'm trying to clear a...
3,405
Posted By vinzping
My understanding of the codes
#!/bin/bash

ret_int() #creating of function
{

#creating a variable with value of the First argument parse in Shell
#In this case, what will be value of $1?
arg=$1

#creating an...
3,405
Posted By vinzping
Ahamed, I noticed you've changed ret_int $i ...
Ahamed, I noticed you've changed

ret_int $i
a[$?]=$i

to

co=$(echo $i | sed 'y/ABCDEFG/1234567/')
a[$co]=$i


Both provide same output, so I'm wondering what does this change does?
3,405
Posted By vinzping
It works perfectly fine! I'll try to...
It works perfectly fine!

I'll try to understand the codes you provided.

Thanks alot ahamed!
Really appreciate it:b:
3,405
Posted By vinzping
It still hits the same error. Currently I'm doing...
It still hits the same error. Currently I'm doing trial and error to see which part of the syntax actually causes this error.
3,405
Posted By vinzping
---------- Post updated at 02:18 PM ----------...
---------- Post updated at 02:18 PM ---------- Previous update was at 02:11 PM ----------

I've copied and paste exactly what you have typed in your earlier post. And now I get only 1 error...
3,405
Posted By vinzping
Tried, error was "gawk: command not...
Tried, error was "gawk: command not found"
3,405
Posted By vinzping
The error I encountered were awk: line 2...
The error I encountered were

awk: line 2 (Which is an empty line) syntax error at or near ]
awk: line 5 (Which is the first "{") syntax error at or near ,


And ahamed, for your "infile" is...
3,405
Posted By vinzping
I'm using Ubuntu 910, currently learning Shell...
I'm using Ubuntu 910, currently learning Shell scripting using BASH.
3,405
Posted By vinzping
Thanks ahamad101!
Thanks for your help!

Sad to say I'm not very familiar with awk. I've tried your codes but I hit some errors and I do not know how to debug it since I'm not very familiar with its syntax.:eek:...
3,405
Posted By vinzping
Thanks for your response. My expected output...
Thanks for your response.

My expected output is


"\t"AB CDE FG
1 XX
2 X X
3
4
5
6
7
where "X" is referring to the data in my flat file (A1,A2 etc).

Currently I'm using...
5,380
Posted By vinzping
Using printf
Hi, below is my suggestion.


input="test" #input stores the value of the "file" you will be using

while read a b c #creates 3 variables to store the value from the "file"
do
printf...
3,405
Posted By vinzping
BASH - storing index value from another file
I'm trying to figure out a way to store the index value from a flat file. The flat file looks like this:


A1,A2,A4,A6,B3,B6,B7,C1,C2,C5,C7,D2,D5,D7,E2,E3,E4,F1,F5,F6,G2,G5


What I'm trying to...
7,833
Posted By vinzping
Thanks alot for your response! For this...
Thanks alot for your response!

For this code,
nrows=${1:-7}Is {1:-7} the syntax for declaring values like "1-7"?

I've done some research on the codes your provided.

typeset -a layout
case...
4,946
Posted By vinzping
BASH - Creating a Matrix
I'm trying to create a Matrix using bash. The expected output is

.AB CDE FG
1
2
3
4
5
6
7

I'm a newbie in shell language, really appreciate if there is anyone who can guide me with...
Forum: Ubuntu 11-06-2011
2,888
Posted By vinzping
Creating Matrix
Hi all, I'm a newbie in shell scripting and currently I'm trying to create a matrix using bash. The Output will look like this

AB CDE FG
1
2
3
4
5
6
7

I'm stuck...
7,833
Posted By vinzping
Creating Matrix from file
Hi all, I'm a newbie in shell scripting and currently I'm trying to create a matrix using bash. The Output will look like this

AB CDE FG
1
2
3
4
5
6
7

I'm stuck...
Showing results 1 to 25 of 25

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