Search Results

Search: Posts Made By: andylbh
Forum: Programming 01-22-2011
6,382
Posted By andylbh
C Socket Client/Server Fork Loop
Hello people.

I'm trying to do something like a search engine.
Server runs in the background by using ./server & which has data from a textfile stored in an array.
Client then runs by using...
Forum: Programming 01-16-2011
7,076
Posted By andylbh
Thanks! I'll go try and figure the locking...
Thanks!

I'll go try and figure the locking up of account.
Forum: Programming 01-15-2011
7,076
Posted By andylbh
C++ Login System help.
I'm new to C++.
I have a text file named idpw.txt which is storing id and password
e.g
admin password
account1 abc
john hello

Here's my code so far:


bool login()
{
string...
2,647
Posted By andylbh
Thanks , but can you kindly explain what this...
Thanks , but can you kindly explain what this code does?
Rarely used printf.
2,647
Posted By andylbh
Is there a simpler way to validate user input for float?
I'm trying to only read price (FLOAT (i.e 1.10, 3.14, etc etc))
If the input is just an integer, I will add a .00 behind. (i.e 3 becomes 3.00 , 20 becomes 20.00)
If the input is without 2 decimal...
12,480
Posted By andylbh
actually I'm trying to make a search function, ...
actually I'm trying to make a search function,
lets say infile.txt

Chocolate:Supermarket A:5
Ice Cream:SuperMarket B:7
Banana:Supermarket B:3

I try to search products under Supermarket B,...
12,480
Posted By andylbh
Cut text and assign them into array
file.txt : is delimiter:

abc:def:ghi
jkl:mno: pqr
123:456:789

if I do the cut command, and cut the first column, and echo it out
I will get the output:

abc
jkl
123

How can I assign...
13,574
Posted By andylbh
yes, 4th 12 is fifth, but can you explain this...
yes, 4th 12 is fifth, but can you explain this code? I can't really understand it.

I understand the part sed '/^Chocolate/s
It means Start With Chocolate, and then substitute right?
What I...
13,574
Posted By andylbh
Really thanks and appreciate your fast reply! ...
Really thanks and appreciate your fast reply!
I'll give the code a try later. (currently learning to do other functions)

Thanks again!
13,574
Posted By andylbh
Thanks guys, another question here. (Sorry, I...
Thanks guys,
another question here. (Sorry, I just started learning bash programming last week)

but what if my data was like this:
Chocolate:12:12:12:12:12:12:12

say I want to replace the...
1,736
Posted By andylbh
Thanks alot !
Thanks alot !
13,574
Posted By andylbh
SED to replace exact match, not first occurrence.
Lets say I have file.txt:
(Product:Price:QuantityAvailable) (: as delimiter)
Chocolate:5:5
Banana:33:3

I am doing a edit/update function.
I want to change the Quantity Available, so I tried...
1,736
Posted By andylbh
Thanks again! It appears that the problem is...
Thanks again!
It appears that the problem is with Floating Point.
I tried changing the text data to numbers without decimal and it works fine.
I'm restricted to using BASH only. Is there a way to...
1,736
Posted By andylbh
hey thanks alot for your help!! I've been...
hey thanks alot for your help!! I've been struggling with this the whole day and can't get it out. Really appreciate your help.
It appears the way I wanted it to.

I have another question:
What...
1,736
Posted By andylbh
Formatting Output from a file
Hi guys.
I'm new to Bash Programming.
I've a little problem here.

I have a text file, lets say data.txt, with the data:
John Tan:Male:20:Singapore
Mary:Female:23:Malaysia
Abdul Rahman Bin...
Showing results 1 to 15 of 15

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