Sponsored Content
Top Forums Shell Programming and Scripting appending data to last line of file Post 302431648 by malcolmpdx on Tuesday 22nd of June 2010 10:50:19 AM
Old 06-22-2010
Very nice. Thanks to all who contributed.

I had forgotten (if I ever knew) that you could use $ as a line marker.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Appending data at the first and last line of a file

Hi, Am trying to write a shell script which will append a header and a footer to an existing file. Header will contain details like the current date while the footer will contain the no: of records listed in the file. I know we can use the CAT command, but i have no clue abt the syntax to... (4 Replies)
Discussion started by: brainstormer
4 Replies

2. Shell Programming and Scripting

Appending the line number and a seperator to each line of a file ?

Hi, I am a newb as far as shell scripting and SED goes so bear with me on this one. I want to basically append to each line in a file a delimiter character and the line's line number e.g Change the file from :- aaaaaa bbbbbb cccccc to:- aaaaaa;1 bbbbbb;2 cccccc;3 I have worked... (4 Replies)
Discussion started by: pjcwhite
4 Replies

3. Shell Programming and Scripting

Appending a line in a file after a particular line

Hello, I have got a C file in which I would like to add an include statement of my own. There are already a few include statements and mine should come right after the last existing one (to be neat). With grep I can get the lines containing the word 'include' and I guess I should feed the... (7 Replies)
Discussion started by: maxvirrozeito
7 Replies

4. Shell Programming and Scripting

appending data to file

Hi. I wrote a very simple script and it doesn't work :( It is supposed to go to a certain directory, execute some command and append the output to the file "expo.dat" what it does is that it writes to the file only one entery. I dont know if Im using the write synthax for "append". Here is... (3 Replies)
Discussion started by: Enigma08
3 Replies

5. Shell Programming and Scripting

Appending a column in one file to the corresponding line in a second

It appears that this has been asked and answered in similar fashions previously, but I am still unsure how to approach this. I have two files containing user information: fileA ttim:/home/ttim:Tiny Tim:632 ppinto:/home/ppinto:Pam Pinto:633 fileB ttim:xkfgjkd*&#^jhdfh... (3 Replies)
Discussion started by: suzannef
3 Replies

6. Shell Programming and Scripting

Appending data to the end of a line

I have searched the forms and I can not find info on appending each line of one file to the same line of another file. I know that I can cat one file to another or append the 2nd file to the end of the 1st but not quite sure how to append one line of data to another. For example File 1 has ... (2 Replies)
Discussion started by: scw132
2 Replies

7. UNIX for Dummies Questions & Answers

Appending Date at the end ONLY in first line of file

Hi, My requirement is to append a date in format DDMMYYYYHHMISS at the end of first line of file which is HEADER. I am trying command sed -i '1s/.*/&<date_format>/' <file_name> Where <date_format>=`date +%m%d%Y%H%M%S` I am somehow misisng the right quotes ti get this added in above... (2 Replies)
Discussion started by: sanjaydubey2006
2 Replies

8. Shell Programming and Scripting

Help with data appending to a file

Hi I have a file called text.txt contains x y z when i run a command i will get output like below x 20 z 30 i want to insert x, z value in text.txt file and should be like this x 20 y 0 z 30 can anyone help me please? (1 Reply)
Discussion started by: siva kumar
1 Replies

9. Shell Programming and Scripting

Bash - Appending to specific line in file

I'm working on a personal project, a multiplication quiz script for my kids. In it, the user's performance will be recorded and written to a file. After they've played it a little while, it will start to focus more on the ones that give them the most trouble-- that take a long time to answer or... (4 Replies)
Discussion started by: treesloth
4 Replies

10. UNIX for Beginners Questions & Answers

Delimiter appending in a data file if we receive a less columns than expected

Required No.of field = 12 Let say you got a “~” delimited input file and this file has 6 input fields and now I want to add 12-5=7 number of “~” into this input file in order to make it 12 fields datafile can have n number of records ex., a~b~c~d~12~r a~b~c~d~12~r a~b~c~d~12~r... (19 Replies)
Discussion started by: LJJ
19 Replies
Restart Markers(3)						 globus ftp client						Restart Markers(3)

NAME
Restart Markers - Data Structures union globus_ftp_client_restart_marker_t Restart marker. Functions globus_result_t globus_ftp_client_restart_marker_init (globus_ftp_client_restart_marker_t *marker) globus_result_t globus_ftp_client_restart_marker_copy (globus_ftp_client_restart_marker_t *new_marker, globus_ftp_client_restart_marker_t *marker) globus_result_t globus_ftp_client_restart_marker_destroy (globus_ftp_client_restart_marker_t *marker) globus_result_t globus_ftp_client_restart_marker_insert_range (globus_ftp_client_restart_marker_t *marker, globus_off_t offset, globus_off_t end_offset) globus_result_t globus_ftp_client_restart_marker_set_ascii_offset (globus_ftp_client_restart_marker_t *marker, globus_off_t offset, globus_off_t ascii_offset) globus_result_t globus_ftp_client_restart_marker_set_offset (globus_ftp_client_restart_marker_t *marker, globus_off_t offset) globus_result_t globus_ftp_client_restart_marker_get_total (globus_ftp_client_restart_marker_t *marker, globus_off_t *total_bytes) globus_result_t globus_ftp_client_restart_marker_to_string (globus_ftp_client_restart_marker_t *marker, char **marker_string) globus_result_t globus_ftp_client_restart_marker_from_string (globus_ftp_client_restart_marker_t *marker, const char *marker_string) Detailed Description FTP Restart Markers. The Globus FTP Client library provides the ability to start a file transfer from a known location into the file. This is accomplished by passing a restart marker to the globus_ftp_client_get(), globus_ftp_client_put(), or globus_ftp_client_third_party_transfer() functions. Function Documentation globus_result_t globus_ftp_client_restart_marker_init (globus_ftp_client_restart_marker_t *marker) Initialize a restart marker. Parameters: marker New restart marker. See also: globus_ftp_client_restart_marker_t, globus_ftp_client_restart_marker_destroy() globus_result_t globus_ftp_client_restart_marker_copy (globus_ftp_client_restart_marker_t *new_marker, globus_ftp_client_restart_marker_t *marker) Create a copy of a restart marker. This function copies the contents of marker to new_marker. Parameters: new_marker A pointer to a new restart marker. marker The marker to copy. See also: globus_ftp_client_restart_marker_init(), globus_ftp_client_restart_marker_destroy() globus_result_t globus_ftp_client_restart_marker_destroy (globus_ftp_client_restart_marker_t *marker) Destroy a restart marker. Parameters: marker Restart marker. This marker must be initialized by either calling globus_ftp_client_restart_marker_init() or globus_ftp_client_restart_marker_copy() See also: globus_ftp_client_restart_marker_t, globus_ftp_client_restart_marker_init(), globus_ftp_client_restart_marker_copy() globus_result_t globus_ftp_client_restart_marker_insert_range (globus_ftp_client_restart_marker_t *marker, globus_off_toffset, globus_off_tend_offset) Insert a range into a restart marker This function updates a restart marker with a new byte range, suitable for using to restart an extended block mode transfer. Adjacent ranges within the marker will be combined into a single entry in the marker. The marker must first be initialized by calling globus_ftp_client_restart_marker_init() or globus_ftp_client_restart_marker_copy(). A marker can only hold a range list or a stream offset. Calling this function after calling globus_ftp_client_restart_marker_set_offset() will result in a marker suitable only for use restarting an extended block mode transfer. Parameters: marker A restart marker offset The starting offset of the range. end_offset The ending offset of the range. See also: globus_ftp_client_restart_marker_set_offset() globus_ftp_client_operationattr_set_mode() globus_result_t globus_ftp_client_restart_marker_set_ascii_offset (globus_ftp_client_restart_marker_t *marker, globus_off_toffset, globus_off_tascii_offset) Set the offset for a restart marker. This function modifies a restart marker to contain a stream offset, suitable for using to restart a steam mode transfer. The marker must first be initialized by calling globus_ftp_client_restart_marker_init() or globus_ftp_client_restart_marker_copy(). A marker can only hold a range list or a stream offset. Calling this function after calling globus_ftp_client_restart_marker_insert_range() will delete the ranges associated with the marker, and replace it with a marker suitable only for use restarting a stream mode transfer. When restarting an ASCII type transfer, use globus_ftp_client_restart_marker_set_ascii_offset() to set both the offset used in the local representation of an ACSII file, and the network representation of the ASCII file. For UNIX systems, the former includes counts newlines as one character towards the file offset, and the latter counts them as 2 characters (CRLF). Parameters: marker A restart marker offset The local stream offset. ascii_offset The network ascii representation of the offset. See also: globus_ftp_client_restart_marker_insert_range(), globus_ftp_client_restart_marker_set_offset(), globus_ftp_client_operationattr_set_mode(), globus_ftp_client_operationattr_set_type() globus_result_t globus_ftp_client_restart_marker_set_offset (globus_ftp_client_restart_marker_t *marker, globus_off_toffset) Set the offset for a restart marker. This function modifies a restart marker to contain a stream offset, suitable for using to restart a steam mode transfer. The marker must first be initialized by calling globus_ftp_client_restart_marker_init() or globus_ftp_client_restart_marker_copy(). A marker can only hold a range list or a stream offset. Calling this function after calling globus_ftp_client_restart_marker_insert_range() will delete the ranges associated with the marker, and replace it with a marker suitable only for use restarting a stream mode transfer. When restarting an ASCII type transfer, the offset must take into account the additional carriage return characters added to the data stream. Parameters: marker A restart marker offset The stream offset See also: globus_ftp_client_restart_marker_insert_range(), globus_ftp_client_operationattr_set_mode(), globus_ftp_client_operationattr_set_type() globus_result_t globus_ftp_client_restart_marker_get_total (globus_ftp_client_restart_marker_t *marker, globus_off_t *total_bytes) Get total bytes accounted for in restart marker This funtion will return the sum of all bytes accounted for in a restart marker. If this restart marker contains a stream offset then this value is the same as the offset (not the ascii offset) that it was set with. If it is a range list, it a sum of all the bytes in the ranges. Parameters: marker A previously initialized or copied restart marker total_bytes pointer to storage for total bytes in marker Returns: o Error on NULL marker or total bytes o <possible return>=''> globus_result_t globus_ftp_client_restart_marker_to_string (globus_ftp_client_restart_marker_t *marker, char **marker_string) Create a string representation of a restart marker. This function sets the marker_string parameter to point to a freshly allocated string suitable for sending as an argument to the FTP REST command, or for a later call to globus_ftp_client_restart_marker_from_string(). The string pointed to by marker_string must be freed by the caller. Parameters: marker An initialized FTP client restart marker. marker_string A pointer to a char * to be set to a freshly allocated marker string. See also: Restart Markers globus_result_t globus_ftp_client_restart_marker_from_string (globus_ftp_client_restart_marker_t *marker, const char *marker_string) Initialize a restart marker from a string. This function initializes a new restart, marker, based on the marker_string parameter. The string may be either a single offset for a stream-mode restart marker, or a comma-separated list of start-end ranges. Parameters: marker The restart marker to be unitialized. marker_string The string containing a textual representation of a restart marker. See also: Restart Markers Author Generated automatically by Doxygen for globus ftp client from the source code. Version 7.3 Mon Apr 30 2012 Restart Markers(3)
All times are GMT -4. The time now is 11:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy