Sponsored Content
Top Forums Shell Programming and Scripting sort file adding extra character Post 302454869 by naamas03 on Monday 20th of September 2010 06:59:17 AM
Old 09-20-2010
Hi
i did your last commands which show exactly what you've posted.
$ od -c REPORT54784
0000000 z \n a
0000003
$ od -c SREPORT54784
0000000 a \n z \n
0000004
my problem is that i have a program which accept this file in constant size of the record.
can i always be sure that the addition will be newline ? and not some other character ?
and if so how can i overcome this problem since i want to keep the file in the same size , due to what i've wrote above.
thanks in advanced
Naama
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding a character in the beginning of every line in a .dat file

How can i add a character(#) in the beginning of every line in a .dat file (2 Replies)
Discussion started by: Cool Coder
2 Replies

2. IP Networking

Adding an extra route to the ip routing table

In my college dorm, there is a file sharing network in the entire building. Problem is, there is only a manual for windows with the settings on how to connect... :mad: They say that you have to give the following command in cmd in windows: route add 172.16.71.0 mask 255.255.255.0... (2 Replies)
Discussion started by: Japie89
2 Replies

3. UNIX for Dummies Questions & Answers

Sort file by character position

Hi! I need to sort file by certain column (column position from-to). I tried sort command, but it works wrong. Example: 0001 5214521 0148 6712145 I need to sort this 2 lines by values from position 9 to 12 (bold) Output: 0148 6712145 0001 5214521 Is there any way how to do this? (2 Replies)
Discussion started by: nadinnne
2 Replies

4. Solaris

Adding Extra Hard Disk

Hi Solaris users - I have an Ultra10 SPARC machine, with IIe processor. To prepare for the Solaris10 admin exam PartII I need to set up the metadb/mirroring in my machine, but do not know how to do this properly. I need this to practice the mirroring tasks. If anyone could help it would be... (3 Replies)
Discussion started by: patcom
3 Replies

5. Shell Programming and Scripting

Adding extra word from file1 to file2

I need to add a word from file1 to file2 accordinggly... file1 contains name of servers and file2 version of server I need that information in a single file so that the format is server_name : version I been trying but havent been able to figure out how to search for a file using sed... ... (14 Replies)
Discussion started by: eponcedeleonc
14 Replies

6. Shell Programming and Scripting

post-Adding character for a text file

#################################################################### #NAME SL.NO TITLE SAL #################################################################### |RAGAV S S | 12358 | SALES EXECUTIVE| | 25000 |RAJU R B | 64253 | SALES EXECUTIVE| ... (5 Replies)
Discussion started by: manas_ranjan
5 Replies

7. Shell Programming and Scripting

Echo to file using SH without adding newline character

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)
Discussion started by: hakermania
3 Replies

8. Shell Programming and Scripting

Adding Extra Commas to a CSV file

Trying in this forum. Not sure if it is permitted.... but in need of help. Please find the requirements in the below link. https://www.unix.com/unix-dummies-questions-answers/191503-add-extra-commas-csv-file-2.html#post302665179 Thanks in Advance. (1 Reply)
Discussion started by: chillblue
1 Replies

9. Shell Programming and Scripting

Adding Extra Column in txt file base on Condition

HI Guys, I have below input. Output Base on Below Condition. 1> if forth column is empty and next coming line have same name with \es then add that column name on all rows 2>rest of all are es:vsDataEUtranCellFDD Input:- CCL01736 CCL01736_7A_1 es:vsDataEUtranCellFDD ... (3 Replies)
Discussion started by: pareshkp
3 Replies

10. Shell Programming and Scripting

Adding an extra date column in UNIX file

Hi All, I have a file with only one column of data (without delimiter). For Ex: cat temp.txt 22055 21088 93840 30990 50990 50950 I want to insert an additional column with current date as value. So, i have used below command but didn't get the result as excepted. Could onyone over... (5 Replies)
Discussion started by: Suresh
5 Replies
fsctl(2)							System Calls Manual							  fsctl(2)

NAME
fsctl - file system control SYNOPSIS
DESCRIPTION
provides access to file-system-specific information. fildes is an open file descriptor for a file in the file system of interest. The possible values for command depend on the type of file system. Currently, defined commands exist only for the CDFS file system (see outbuf is a pointer to the data area in which data is returned from the file system. outlen gives the length of the data area pointed to by outbuf. The CDFS commands are: Returns the directory record for the file or directory indicated by fildes. The record is returned in a structure of type cddir, defined in Returns the extended attribute record, if any, for the file or directory indicated by fildes. Because the size of an extended attribute record varies, be sure outbuf points to a data area of sufficient size. To find the necessary size, do the following: 1. Use statfs(2). to get the logical block size of the CDFS volume. 2. Use an call with the command to get the extended attribute record size (in blocks) for the file or directory of interest. The field in the returned structure contains the size of the extended attribute record in logi- cal blocks. (If this field is zero, the file or directory has no extended attribute record.) 3. Multiply by the logical block size obtained in step 1 to get the total space needed. 4. Once you get the extended attribute record, cast outbuf into a pointer to a structure of type (defined in This enables you to access those fields that are common to all extended attribute records. (See below for an example of this process.) If the extended attribute record contains additional system use or application use data, that data will have to be accessed manually. Returns the abstract file identifier for the primary volume whose root directory is specified by fildes, terminated with a NULL character. Note that the constant defined in gives the maximum length a file identifier can have. Thus, + 1 can be used for outlen and the size of outbuf. Returns the bibliographic file identifier for the primary volume whose root directory is specified by fildes, terminated with a NULL character. + 1 can be used for the value of outlen and the size of outbuf. Returns the copyright file identifier for the primary volume whose root directory is specified by fildes, terminated with a NULL character. + 1 can be used for the value of outlen and the size of outbuf. Returns the volume ID for the primary volume specified by fildes, terminated with a NULL character. The maximum size of the volume ID is 32 bytes, so a length of 33 can be used for outlen and the size of utbuf. Returns the volume set ID for the primary volume specified by fildes, terminated with a NULL character. The maximum size of the volume set ID is 128 bytes, so a length of 129 can be used for outlen and the size of outbuf. EXAMPLES
The following code fragment gets the extended attribute record for a file on a CDFS volume. The filename is passed in as the first argu- ment to the routine. Note that error checking is omitted for brevity. RETURN VALUE
returns the number of bytes read if successful. If an error occurs, -1 is returned and is set to indicate the error. ERRORS
fails if any of the following conditions are encountered: [EBADF] fildes is not a valid open file descriptor. [EFAULT] outbuf points to an invalid address. [ENOENT] The requested information does not exist. [EINVAL] command is not a valid command. [EINVAL] fildes does not refer to a CDFS file system. SEE ALSO
statfs(2), cdnode(4), cdrom(4). fsctl(2)
All times are GMT -4. The time now is 02:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy