Hi,
I have a situation where I have to specify a different value to an awk command, I beleive i have the gist of this done, however I am not able to get this correct. Here is what I have so far
echo $id
065859555
This value occurs in a "pipe" delimited file in postition 8. Hence I would... (1 Reply)
I know multiple values can be returned from a function in C like this:
char **read_file ( char * , unsigned long int * );//this is the function prototypeunsigned long int number_of_words = 0;//variable defined in main() and initialized to 0words_from_dictionary = read_file ( "dictionary.dit" ,... (2 Replies)
Hi,
I'm trying to write a bash script that takes a file and passes each line from the file into an array with elements separated by column.
For example:
Sample file "file1.txt":
1 name1 a first
2 name2 b second
3 name3 c third
and have arrays such as:
line1 = ( "1" "name1" "a"... (3 Replies)
sqlplus -s $USER_ID@$SID/$PWD<<EOF>sql_1.txt
set feedback off
set heading off
select 114032 as c_1 from dual ;
EOF
for i in `cat sql_1.txt`
do
sh script_1.sh $i
Currently i am passing one column value to the single unix variable.
How can i pass the values from 2... (2 Replies)
I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables.
I need to read this file which is an input to my script
Config.txt
file name, first path, second... (7 Replies)
Hi Guys,
i have a file where data is in the below format::
data1 data2
data3 data4
data4 data6
my script written as::
#!/bin/ksh
cd $1
at now <<END
sh $2
END
Here i want to pass the values stored in the above file one by one till the end of line.
Here if i am doing it as:: (2 Replies)
:wall: Hi,
I have an XML file with 5 tags. I need to pass values to the XML file from a shell script that will replace values in 2 of the tags. I cannot hardcode the tag values in XML and use replace command in script as the values are likely to change.
Please help !!!!!!!!!!! (2 Replies)
Hi All,
We have a requirement of picking nth position value by using cut command. value would be delimited by any symbols. We have to pass delimited value and postition to get the value in a string.
ex.
echo "A,B,C,D,E" |cut -d "," -f3
echo "A|B|C|D|E"|cut -d "|" -f2
Kindly frame the... (5 Replies)
Discussion started by: KK230689
5 Replies
LEARN ABOUT PLAN9
pack_fopen
pack_fopen(3alleg4) Allegro manual pack_fopen(3alleg4)NAME
pack_fopen - Opens a file according to mode. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
PACKFILE *pack_fopen(const char *filename, const char *mode);
DESCRIPTION
Opens a file according to mode, which may contain any of the flags:
`r' - open file for reading.
`w' - open file for writing, overwriting any existing data.
`p' - open file in packed mode. Data will be compressed as it is written to the file, and automatically uncompressed during read opera-
tions. Files created in this mode will produce garbage if they are read without this flag being set.
`!' - open file for writing in normal, unpacked mode, but add the value F_NOPACK_MAGIC to the start of the file, so that it can later be
opened in packed mode and Allegro will automatically detect that the data does not need to be decompressed.
Instead of these flags, one of the constants F_READ, F_WRITE, F_READ_PACKED, F_WRITE_PACKED or F_WRITE_NOPACK may be used as the mode
parameter.
The packfile functions also understand several "magic" filenames that are used for special purposes. These are:
`#' - read data that has been appended to your executable file with the exedat utility, as if it was a regular independent disk file.
`filename.dat#object_name' - open a specific object from a datafile, and read from it as if it was a regular file. You can treat nested
datafiles exactly like a normal directory structure, for example you could open `filename.dat#graphics/level1/mapdata'.
`#object_name' - combination of the above, reading an object from a datafile that has been appended onto your executable.
With these special filenames, the contents of a datafile object or appended file can be read in an identical way to a normal disk file, so
any of the file access functions in Allegro (eg. load_pcx() and set_config_file()) can be used to read from them. Note that you can't write
to these special files, though: the fake file is read only. Also, you must save your datafile uncompressed or with per-object compression
if you are planning on loading individual objects from it (otherwise there will be an excessive amount of seeking when it is read).
Finally, be aware that the special Allegro object types aren't the same format as the files you import the data from. When you import data
like bitmaps or samples into the grabber, they are converted into a special Allegro-specific format, but the `#' marker file syntax reads
the objects as raw binary chunks. This means that if, for example, you want to use load_pcx() to read an image from a datafile, you should
import it as a binary block rather than as a BITMAP object.
Example:
PACKFILE *input_file;
input_file = pack_fopen("scores.dat", "rp");
if (!input_file)
abort_on_error("Couldn't read `scores.dat'!");
RETURN VALUE
On success, pack_fopen() returns a pointer to a PACKFILE structure, and on error it returns NULL and stores an error code in `errno'. An
attempt to read a normal file in packed mode will cause `errno' to be set to EDOM.
SEE ALSO pack_fclose(3alleg4), pack_fopen_chunk(3alleg4), packfile_password(3alleg4), pack_fread(3alleg4), pack_getc(3alleg4),
file_select_ex(3alleg4), pack_fopen_vtable(3alleg4), expackf(3alleg4)Allegro version 4.4.2 pack_fopen(3alleg4)