I'm working on formatting some attendance data to meet a vendors requirements to upload to their system. With some help on the forums here, I have the data close. But they've since changed what they want.
The vendor wants me to submit three fields to them. Field 1 is the studentid field,... (4 Replies)
hi forums
i need help with a little problem i am having.
i need to count the number of fields that are in a saved variable so i can use that number to make a different function work properly.
is there a way of doing this without using SED/AWK?
anything would be greatly appreciated (4 Replies)
Hi Gurus,
Have a file seperated by "~" and no of fields is 104. When i try to run awk, it erros out.
awk: record `B~A31~T24_STF~~~2009...' has too many fields
Any idea how can i extract a specific filed with this many fields in a row.
Kindly help (3 Replies)
I have a CSV file with a variable number of fields per record. How do I print lines of a certain number of fields only? Several permutations of the following (including the use of escape characters) have failed to retrieve the line I'm after (1,2,3,4)...
$ cat myfile
1,2,3,4
1,2,3
$ # Print... (1 Reply)
I want to use awk to split fields and put them into a file
but I don't know the number of fields
for example, in the following line
Ports: 22/filtered/tcp//ssh///, 53/open/tcp//tcpwrapped///, 111/filtered/tcp//rpcbind///, 543/filtered/tcp//klogin///, 544/filtered/tcp//kshell///,... (3 Replies)
Hi,
With:
# VALUES="one~two~~~"
# echo $VALUES | awk 'BEGIN {FS="~"} {print NF}'
5
I can determine the number of fields.
How to determine the number of fields with a value ?
In this case 2.
Thanks in advance,
ejdv (6 Replies)
Hy!
I need to post-process some data files which have variable (and periodic) number of fields. For example, I need to square (data -> data*data) the folowing data file: -5.34281E-28 -3.69822E-29 8.19128E-29 9.55444E-29 8.16494E-29 6.23125E-29
4.42106E-29 2.94592E-29 1.84841E-29 ... (5 Replies)
Hi,
input:
AA|BB|CC
DD|EE
FF
what I am trying to get:
AA|BB|CC
DD|EE|
FF||
I tried to create first an UDF for printing repeats, but I think I have an issue with my END section or my array:
function repeat(str, n, rep, i)
{
for(i=1 ;i<n;i++)
rep=rep str
return rep
}
... (6 Replies)
If a file has following kind of data, comma delimited
1,2,3,4
1
1
1,2,3,4
1,2
2
2,3,4
My required output must have only 4 columns with comma delimited
1,2,3,4
111,2,3,4
1,222,3,4
I have tried many awk command using ORS="" but couldnt progress (10 Replies)
Hi,
Below are the sample files. x.txt is from an Excel file that is a list of users from Windows and y.txt is a list of database account.
$ head -500 x.txt y.txt
==> x.txt <==
TEST01 APP_USER_PROFILE
USER03 APP_USER_PROFILE
TEST02 APP_USER_EXP_PROFILE
TEST04 APP_USER_PROFILE
USER01 ... (3 Replies)
Discussion started by: newbie_01
3 Replies
LEARN ABOUT BSD
bj
BJ(6) Games Manual BJ(6)NAME
bj - the game of black jack
SYNOPSIS
/usr/games/bj
DESCRIPTION
Bj is a serious attempt at simulating the dealer in the game of black jack (or twenty-one) as might be found in Reno. The following rules
apply:
The bet is $2 every hand.
A player `natural' (black jack) pays $3. A dealer natural loses $2. Both dealer and player naturals is a `push' (no money exchange).
If the dealer has an ace up, the player is allowed to make an `insurance' bet against the chance of a dealer natural. If this bet is
not taken, play resumes as normal. If the bet is taken, it is a side bet where the player wins $2 if the dealer has a natural and
loses $1 if the dealer does not.
If the player is dealt two cards of the same value, he is allowed to `double'. He is allowed to play two hands, each with one of
these cards. (The bet is doubled also; $2 on each hand.)
If a dealt hand has a total of ten or eleven, the player may `double down'. He may double the bet ($2 to $4) and receive exactly one
more card on that hand.
Under normal play, the player may `hit' (draw a card) as long as his total is not over twenty-one. If the player `busts' (goes over
twenty-one), the dealer wins the bet.
When the player `stands' (decides not to hit), the dealer hits until he attains a total of seventeen or more. If the dealer busts,
the player wins the bet.
If both player and dealer stand, the one with the largest total wins. A tie is a push.
The machine deals and keeps score. The following questions will be asked at appropriate times. Each question is answered by y followed by
a new line for `yes', or just new line for `no'.
? (means, `do you want a hit?')
Insurance?
Double down?
Every time the deck is shuffled, the dealer so states and the `action' (total bet) and `standing' (total won or lost) is printed. To exit,
hit the interrupt key (DEL) and the action and standing will be printed.
BJ(6)