Hi All,
I am facing a strange situation and want to find why it is occuring . When i convert the whole line into Hexadecimal character i can find the junk value after new line (\n) . If i look in binary mode it is not visible.
PLease let me know how possible the junk character is added... (1 Reply)
Hi All,
Is there any way to append a newline character at the end of a file(coma-separated file), through shell script?
I need to check whether newline character exists at the end of a file, if it does not then append it.
Regards,
Krishna (1 Reply)
Hi All,
I have named a file with current date,time and year as follows:
month=`date | awk '{print $2}'`
date=`date | awk '{print $3}'`
year=`date | awk '{print $6}'`
time=`date +%Hh_%Mm_%Ss'`
filename="test_"$month"_"$date"_"$year"_"$time".txt"
> $filename
The file is created with a... (2 Replies)
Hi All,
I have file with only one record,always be only one record. as like below.
if that line contains newline end of the line..no need to add, if not just add the new line character.
END OF FILE. ROW COUNT: 7
Please help me..
Thanks, (9 Replies)
Hello!
I am able to do this in bash, using:
echo -ne HELLO > file.txt
and then, 'HELLO' is written into file.txt without the newline character to be added in the end of the file.
How is this possible to be done using sh instead of bash?
If I try something similar is SH, then inside... (3 Replies)
Hi All,
I have following piece of code in UNIX C Shell script and I want to add one more command which can add newline at the end of file only if there is no newline character exists.
foreach file (`ls $dd_PLAYCARD_EDI_IN`)
if ( -f $dd_PLAYCARD_EDI_IN/${file} ) then
cat -n... (4 Replies)
Hi Gurus,
Need help. I'm a beginner in Unix. I have a requirement, need to add or append newline (\n) character in file.
Sample Data:
1|Main|Test|~#
2|Main|Hello|~#
3|Main|Unix|~#
4|Main|File|~#Output:
1|Main|Test|~#
2|Main|Hello|~#
3|Main|Unix|~#
4|Main|File|~#\n -- append only... (13 Replies)
Hi below is my file.
cat input.dat
101,abhilash,1000
102,prave
en,2000
103,partha,4
000
10
4,naresh,5000
(its just a example file)
and my output should be:
101,abhilash,1000
102,praveen,2000
103,partha,4000
104,naresh,5000
below is my code
cat input.dat |tr -d '\n' >... (6 Replies)
Hello all,
I have maybe a simple Problem - but I do not know to handle it.
All what I want, is to write a line to file without a newline at the end. It works with "echo -n" for all lines, but not for the last one. At the end of the file is always a "0a" (hex)
My small script:
... (10 Replies)
I have a file which comes every day and the file data look's as below.
Vi abc.txt
a|b|c|d\n
a|g|h|j\n
Some times we receive the file with only a new line character in the file like
vi abc.txt
\n (8 Replies)
Discussion started by: rak Kundra
8 Replies
LEARN ABOUT PHP
yaz_sort
YAZ_SORT(3) 1 YAZ_SORT(3)yaz_sort - Sets sorting criteriaSYNOPSIS
void yaz_sort (resource $id, string $criteria)
DESCRIPTION
This function sets sorting criteria and enables Z39.50 Sort.
Call this function beforeyaz_search(3). Using this function alone does not have any effect. When used in conjunction with yaz_search(3), a
Z39.50 Sort will be sent after a search response has been received and before any records are retrieved with Z39.50 Present
(yaz_present(3).
PARAMETERS
o $id
- The connection resource returned by yaz_connect(3).
o $criteria
- A string that takes the form field1 flags1 field2 flags2 where field1 specifies the primary attributes for sort, field2 seconds,
etc.. The field specifies either a numerical attribute combinations consisting of type=value pairs separated by comma (e.g.
1=4,2=1) ; or the field may specify a plain string criteria (e.g. title. The flags is a sequence of the following characters
which may not be separated by any white space.
Sort Flags
o a - Sort ascending
o d - Sort descending
o i - Case insensitive sorting
o s - Case sensitive sorting
RETURN VALUES
No value is returned.
EXAMPLES
Example #1
Sort Criterias
To sort on Bib1 attribute title, case insensitive, and ascending you would use the following sort criteria:
1=4 ia
If the secondary sorting criteria should be author, case sensitive and ascending you would use:
1=4 ia 1=1003 sa
PHP Documentation Group YAZ_SORT(3)